tsk-202: Cleanup

This commit is contained in:
kdeng00
2025-10-30 16:41:34 -04:00
parent 9f3e49bd01
commit 677822d171
+6 -4
View File
@@ -69,7 +69,8 @@ pub mod endpoint {
match crate::repo::song::get_song(&pool, &song_id).await {
Ok(song) => {
let directory = icarus_envy::environment::get_root_directory().await.value;
let file_type = icarus_meta::detection::coverart::file_type_from_data(&data).unwrap();
let file_type =
icarus_meta::detection::coverart::file_type_from_data(&data).unwrap();
let coverart_type = if file_type.file_type
== icarus_meta::detection::coverart::constants::JPEG_TYPE
{
@@ -86,11 +87,12 @@ pub mod endpoint {
response.message = String::from("Invalid CoverArt type");
return (
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
axum::Json(response)
axum::Json(response),
);
};
// TODO: Make this random and the file extension should not be hard coded
let filename = icarus_models::coverart::generate_filename(coverart_type, true).unwrap();
let filename =
icarus_models::coverart::generate_filename(coverart_type, true)
.unwrap();
let mut coverart =
icarus_models::coverart::init::init_coverart_dir_and_filename(