tsk-213: Identify audio file type in initial step when queueing #225

Merged
kdeng00 merged 7 commits from tsk-213 into main 2025-10-29 14:58:34 -04:00
Showing only changes of commit e0d6cbcbf5 - Show all commits
+14 -1
View File
@@ -411,9 +411,12 @@ pub mod endpoint {
);
let raw_data: Vec<u8> = data.to_vec();
match super::is_song_valid(&raw_data).await {
Ok(valid) => {
if valid {
match repo::song::update(&pool, &raw_data, &id).await {
Ok(_) => {
response.message = String::from("Successful");
response.message = String::from(super::super::super::response::SUCCESSFUL);
response.data.push(id);
(axum::http::StatusCode::OK, axum::Json(response))
}
@@ -422,6 +425,16 @@ pub mod endpoint {
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
}
} else {
response.message = String::from("Invalid song type");
return (axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(response))
}
}
Err(err) => {
response.message = err.to_string();
return (axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(response));
}
}
} else {
response.message = String::from("No data provided");
(axum::http::StatusCode::NOT_FOUND, axum::Json(response))