This commit is contained in:
Erica Z 2024-11-21 22:28:45 +01:00
parent e4c54dc6f5
commit 4fd1723f37

View file

@ -159,25 +159,23 @@ impl Player {
if let Some(song) = self.window().song() { if let Some(song) = self.window().song() {
map.insert( map.insert(
"mpris:trackid", "mpris:trackid",
Value::new(format!("/eu/callcc/audrey/Track/{}", song.counter())).to_owned(), format!("/eu/callcc/audrey/Track/{}", song.counter()).into(),
); );
map.insert( map.insert(
"mpris:length", "mpris:length",
Value::new((self.window().duration() * MICROSECONDS) as i64), ((self.window().duration() * MICROSECONDS) as i64).into(),
); );
map.insert( map.insert(
"mpris:artUrl", "mpris:artUrl",
Value::new( (url::Url::from_file_path(audrey::globals::art_path())
url::Url::from_file_path(audrey::globals::art_path())
.unwrap() .unwrap()
.to_string(), .to_string(),)
) .into(),
.to_owned(),
); );
map.insert("xesam:album", Value::new(song.album())); map.insert("xesam:album", song.album().into());
// TODO: use the right opensubsonic data // TODO: use the right opensubsonic data
map.insert("xesam:artist", Value::new(vec![song.artist()])); map.insert("xesam:artist", vec![song.artist()].into());
map.insert("xesam:title", Value::new(song.title())); map.insert("xesam:title", song.title().into());
} }
map map