tsk-62: Use QueuedSong and QueuedCoverArt to replace references to path of Song and CoverArt #64
11
src/main.rs
11
src/main.rs
@@ -332,10 +332,19 @@ async fn prep_song(
|
|||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let queued_song = queued_item::QueuedSong {
|
let queued_song: crate::queued_item::QueuedSong = match song.save_to_filesystem() {
|
||||||
|
Ok(_) => {
|
||||||
|
queued_item::QueuedSong {
|
||||||
id: *song_queue_id,
|
id: *song_queue_id,
|
||||||
song,
|
song,
|
||||||
path: songpath
|
path: songpath
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
eprintln!("Error: {err:?}");
|
||||||
|
queued_item::QueuedSong{..Default::default()}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
println!("Saved at: {:?}", queued_song.path);
|
println!("Saved at: {:?}", queued_song.path);
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct QueuedSong {
|
pub struct QueuedSong {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
pub song: icarus_models::song::Song,
|
pub song: icarus_models::song::Song,
|
||||||
pub path: String,
|
pub path: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct QueuedCoverArt {
|
pub struct QueuedCoverArt {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
pub coverart: icarus_models::coverart::CoverArt,
|
pub coverart: icarus_models::coverart::CoverArt,
|
||||||
|
Reference in New Issue
Block a user