tsk-56: Address hard coded file extensions (#63)
All checks were successful
Rust Build / Check (push) Successful in 43s
Rust Build / Test Suite (push) Successful in 40s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 39s
Rust Build / build (push) Successful in 45s

Closes #56

Reviewed-on: #63
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
2025-10-22 16:34:11 +00:00
committed by phoenix
parent a2128f99e6
commit 106867e5ee
3 changed files with 7 additions and 6 deletions

2
Cargo.lock generated
View File

@@ -1322,7 +1322,7 @@ dependencies = [
[[package]] [[package]]
name = "songparser" name = "songparser"
version = "0.4.5" version = "0.4.6"
dependencies = [ dependencies = [
"futures", "futures",
"icarus_envy", "icarus_envy",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "songparser" name = "songparser"
version = "0.4.5" version = "0.4.6"
edition = "2024" edition = "2024"
rust-version = "1.90" rust-version = "1.90"

View File

@@ -232,8 +232,9 @@ async fn some_work(
println!("Updated queued song"); println!("Updated queued song");
println!("Response: {_inner_response:?}"); println!("Response: {_inner_response:?}");
// TODO: Place this somewhere else let song_type = String::from(
let song_type = String::from("flac"); icarus_meta::detection::song::constants::FLAC_TYPE,
);
match api::create_song::create( match api::create_song::create(
app, &metadata, user_id, &song_type, app, &metadata, user_id, &song_type,
@@ -424,9 +425,9 @@ pub async fn generate_coverart_queue_dir_and_filename(file_type: &str) -> (Strin
filename += if file_type == icarus_meta::detection::coverart::constants::JPEG_TYPE filename += if file_type == icarus_meta::detection::coverart::constants::JPEG_TYPE
|| file_type == icarus_meta::detection::coverart::constants::JPG_TYPE || file_type == icarus_meta::detection::coverart::constants::JPG_TYPE
{ {
".jpeg" icarus_models::constants::file_extensions::image::JPEGEXTENSION
} else if file_type == icarus_meta::detection::coverart::constants::PNG_TYPE { } else if file_type == icarus_meta::detection::coverart::constants::PNG_TYPE {
".png" icarus_models::constants::file_extensions::image::PNGEXTENSION
} else { } else {
"" ""
}; };