diff --git a/player/Cargo.toml b/player/Cargo.toml index 60b630e..cf0b7b0 100644 --- a/player/Cargo.toml +++ b/player/Cargo.toml @@ -6,7 +6,7 @@ license = "LGPL-2.1-only OR GPL-3.0-only" readme = "README.md" [dependencies] -rodio = { version = "^0.15", features = ["symphonia-all"]} +rodio = { version = "^0.16", features = ["symphonia-all"]} m3u8-rs = { version = "^3.0" } fluent-uri = { version = "^0.1" } mpd = { version = "0.0.12", optional = true } diff --git a/player/src/os_controls.rs b/player/src/os_controls.rs index 15cd9e6..0a8dd10 100644 --- a/player/src/os_controls.rs +++ b/player/src/os_controls.rs @@ -203,22 +203,26 @@ impl SystemControlWrapper { fn build_metadata(item: Item) -> Metadata { let file_uri = item.field("filename").and_then(|x| x.to_owned().to_str()); Metadata { - length: None, - art_url: None, //file_uri.clone() TODO do this without having to rip the art image from the file like Elisa + length: None, // populated separately + art_url: item.field("cover") + .and_then(|x| x.to_owned().to_str()), album: item.field("album").and_then(|x| x.to_owned().to_str()), album_artist: item .field("albumartist") - .map( - |x| x.to_owned() - .to_str() - .map(|x2| vec![x2]) - ).flatten(), + .and_then(|x| x.to_owned().to_str()) + .map(|x| x.split(",").map(|s| s.trim().to_owned()).collect()), artist: item .field("artist") .and_then(|x| x.to_owned().to_str()) .map(|x| x.split(",").map(|s| s.trim().to_owned()).collect()), - composer: None, - disc_number: None, + composer: item + .field("composer") + .and_then(|x| x.to_owned().to_str()) + .map(|x| x.split(",").map(|s| s.trim().to_owned()).collect()), + disc_number: item + .field("disc") + .and_then(|x| x.to_owned().to_i64()) + .map(|track| track as i32), genre: item .field("genre") .and_then(|x| x.to_owned().to_str())