Fix build error

This commit is contained in:
Brandon Thomas committed 2022-07-03 23:10:12 -04:00
1 parent f7880fca97
commit db4c260e08
1 file changed
+9 -2
@@ -137,8 +137,15 @@ pub async fn upload_tts_model_handler(
let title = request.title.to_string();
let download_url = request.download_url.to_string();
if is_bad_tts_model_download_url(&download_url) {
return Err(UploadTtsModelError::BadInput("Bad model download URL".to_string()));
match is_bad_tts_model_download_url(&download_url) {
Ok(false) => {} // Ok case
Ok(true) => {
return Err(UploadTtsModelError::BadInput("Bad model download URL".to_string()));
}
Err(err) => {
warn!("Error parsing url: {:?}", err);
return Err(UploadTtsModelError::BadInput("Bad model download URL".to_string()));
}
}
let tts_model_type = "tacotron2".to_string();