diff --git a/src/api.rs b/src/api.rs index e89990e..e11da54 100644 --- a/src/api.rs +++ b/src/api.rs @@ -307,7 +307,7 @@ pub mod wipe_data { pub mod song_queue { pub async fn wipe_data( app: &crate::config::App, - queued_song: &crate::queued_item::QueuedSong + queued_song: &crate::queued_item::QueuedSong, ) -> Result { let client = reqwest::Client::builder().build()?; let url = format!("{}/api/v2/song/queue/data/wipe", app.uri); @@ -331,7 +331,7 @@ pub mod wipe_data { pub mod coverart_queue { pub async fn wipe_data( app: &crate::config::App, - queued_coverart: &crate::queued_item::QueuedCoverArt + queued_coverart: &crate::queued_item::QueuedCoverArt, ) -> Result { let client = reqwest::Client::builder().build()?; let url = format!("{}/api/v2/coverart/queue/data/wipe", app.uri); diff --git a/src/main.rs b/src/main.rs index c5a25bf..e47cf85 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,12 +65,10 @@ async fn main() -> Result<(), Box> { coverart, _metadata, queued_song, - queued_coverart - // (song_queue_id, _song_queue_path), - // (coverart_queue_id, _coverart_queue_path), + queued_coverart, // (song_queue_id, _song_queue_path), + // (coverart_queue_id, _coverart_queue_path), )) => { - match wipe_data_from_queues(&app, &queued_song, &queued_coverart) - .await + match wipe_data_from_queues(&app, &queued_song, &queued_coverart).await { Ok(_) => match cleanup(&song, &coverart).await { Ok(_) => { @@ -106,7 +104,7 @@ async fn main() -> Result<(), Box> { async fn wipe_data_from_queues( app: &config::App, queued_song: &crate::queued_item::QueuedSong, - queued_coverart: &crate::queued_item::QueuedCoverArt + queued_coverart: &crate::queued_item::QueuedCoverArt, ) -> Result<(), std::io::Error> { match api::wipe_data::song_queue::wipe_data(app, queued_song).await { Ok(response) => match response @@ -185,7 +183,7 @@ async fn some_work( icarus_models::coverart::CoverArt, api::get_metadata_queue::response::Metadata, queued_item::QueuedSong, - queued_item::QueuedCoverArt + queued_item::QueuedCoverArt, ), std::io::Error, > { @@ -220,15 +218,9 @@ async fn some_work( }; */ - match metadata::apply_metadata(&queued_song, &queued_coverart, &metadata).await - { + match metadata::apply_metadata(&queued_song, &queued_coverart, &metadata).await { Ok(_applied) => { - match api::update_queued_song::update_queued_song( - app, - &queued_song, - ) - .await - { + match api::update_queued_song::update_queued_song(app, &queued_song).await { Ok(response) => { match response .json::() @@ -332,20 +324,20 @@ async fn prep_song( }; */ - let queued_song: crate::queued_item::QueuedSong = match song.save_to_filesystem() { - Ok(_) => { - queued_item::QueuedSong { - id: *song_queue_id, - song, - path: songpath - } - - } - Err(err) => { - eprintln!("Error: {err:?}"); - queued_item::QueuedSong{..Default::default()} - } - }; + let queued_song: crate::queued_item::QueuedSong = + match song.save_to_filesystem() { + Ok(_) => queued_item::QueuedSong { + id: *song_queue_id, + song, + path: songpath, + }, + Err(err) => { + eprintln!("Error: {err:?}"); + queued_item::QueuedSong { + ..Default::default() + } + } + }; println!("Saved at: {:?}", queued_song.path); diff --git a/src/metadata/mod.rs b/src/metadata/mod.rs index 1e28f59..87283d6 100644 --- a/src/metadata/mod.rs +++ b/src/metadata/mod.rs @@ -122,7 +122,10 @@ pub async fn apply_metadata( } } - match icarus_meta::meta::coverart::set_coverart(&queued_song.path, &queued_coverart.path) { + match icarus_meta::meta::coverart::set_coverart( + &queued_song.path, + &queued_coverart.path, + ) { Ok(_data) => { if _data.is_empty() { println!("There was an issue");