From f6f2282bd197d5eb34de187d761d204dada0fae1 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 31 Oct 2025 12:07:01 -0400 Subject: [PATCH 1/3] tsk-200: Utilizing mime for Content type for fetching queued CoverArt data --- src/callers/queue/coverart.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/callers/queue/coverart.rs b/src/callers/queue/coverart.rs index 22bf99b..a0750c8 100644 --- a/src/callers/queue/coverart.rs +++ b/src/callers/queue/coverart.rs @@ -318,11 +318,12 @@ pub mod endpoint { ) -> (axum::http::StatusCode, axum::response::Response) { match repo::coverart::get_coverart_queue_data_with_id(&pool, &id).await { Ok(data) => { + let file_type = icarus_meta::detection::coverart::file_type_from_data(&data).unwrap(); let bytes = axum::body::Bytes::from(data); let mut response = bytes.into_response(); let headers = response.headers_mut(); // TODO: Address this hard coding for the coverart content type - headers.insert(axum::http::header::CONTENT_TYPE, "image".parse().unwrap()); + headers.insert(axum::http::header::CONTENT_TYPE, file_type.mime.parse().unwrap()); // TODO: Make the conent disposition more dynamic headers.insert( axum::http::header::CONTENT_DISPOSITION, -- 2.47.3 From a68a4ecab2b9b8d38568cfb49700fbcefd997296 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 31 Oct 2025 12:09:08 -0400 Subject: [PATCH 2/3] tsk-200: Cleanup --- src/callers/queue/coverart.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/callers/queue/coverart.rs b/src/callers/queue/coverart.rs index a0750c8..2ca3748 100644 --- a/src/callers/queue/coverart.rs +++ b/src/callers/queue/coverart.rs @@ -318,12 +318,15 @@ pub mod endpoint { ) -> (axum::http::StatusCode, axum::response::Response) { match repo::coverart::get_coverart_queue_data_with_id(&pool, &id).await { Ok(data) => { - 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 bytes = axum::body::Bytes::from(data); let mut response = bytes.into_response(); let headers = response.headers_mut(); - // TODO: Address this hard coding for the coverart content type - headers.insert(axum::http::header::CONTENT_TYPE, file_type.mime.parse().unwrap()); + headers.insert( + axum::http::header::CONTENT_TYPE, + file_type.mime.parse().unwrap(), + ); // TODO: Make the conent disposition more dynamic headers.insert( axum::http::header::CONTENT_DISPOSITION, -- 2.47.3 From 587c5a73afea127e1e68c1e80a4b054d1f676a07 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 31 Oct 2025 12:09:22 -0400 Subject: [PATCH 3/3] tsk-200: Version bump --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b83b52e..672fd45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -964,7 +964,7 @@ dependencies = [ [[package]] name = "icarus" -version = "0.3.15" +version = "0.3.16" dependencies = [ "axum", "axum-extra", diff --git a/Cargo.toml b/Cargo.toml index 3c2229f..7517d72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus" -version = "0.3.15" +version = "0.3.16" edition = "2024" rust-version = "1.90" -- 2.47.3