From 1945c2357f0ab14fcfcd9bc3fc1f434937c48be4 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Wed, 18 Jun 2025 20:46:43 -0400 Subject: [PATCH] Code cleanup and formatting --- src/main.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5a238c4..e8ff9f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,7 +88,7 @@ async fn process_song(api_url: &String, song_queue_id: &uuid::Uuid) -> Result<() Ok(response) => { let coverart_queue_id = &response.data[0].id; println!("Coverart queue Id: {:?}", coverart_queue_id); - // TODO: Get queued coverart's data + match api::get_coverart_queue::get_data(api_url, &coverart_queue_id).await { Ok(response) => match api::parsing::parse_response_into_bytes(response).await { Ok(coverart_queue_bytes) => { @@ -96,6 +96,13 @@ async fn process_song(api_url: &String, song_queue_id: &uuid::Uuid) -> Result<() let save_path = save_file_to_fs(&directory, &filename, &coverart_queue_bytes).await; println!("Saved coverart queue file at: {:?}", save_path); + + // TODO: Apply metadata to the queued song (modifying file) + // TODO: Update the queued song with the updated queued song + // TODO: Create song + // TODO: Create coverart + // TODO: Wipe data from queued song + // TODO: Wipe data from queued coverart } Err(err) => { eprintln!("Error: {:?}", err); @@ -105,12 +112,6 @@ async fn process_song(api_url: &String, song_queue_id: &uuid::Uuid) -> Result<() eprintln!("Error: {:?}", err); } } - // TODO: Apply metadata to the queued song (modifying file) - // TODO: Update the queued song with the updated queued song - // TODO: Create song - // TODO: Create coverart - // TODO: Wipe data from queued song - // TODO: Wipe data from queued coverart } Err(err) => { eprintln!("Error: {:?}", err); @@ -325,7 +326,10 @@ mod api { .await } - pub async fn get_data(base_url: &String, coverart_queue_id: &uuid::Uuid) -> Result { + pub async fn get_data( + base_url: &String, + coverart_queue_id: &uuid::Uuid, + ) -> Result { let client = reqwest::Client::new(); let endpoint = String::from("api/v2/coverart/queue/data"); let api_url = format!("{}/{}/{}", base_url, endpoint, coverart_queue_id);