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() {
map.insert(
"mpris:trackid",
Value::new(format!("/eu/callcc/audrey/Track/{}", song.counter())).to_owned(),
format!("/eu/callcc/audrey/Track/{}", song.counter()).into(),
);
map.insert(
"mpris:length",
Value::new((self.window().duration() * MICROSECONDS) as i64),
((self.window().duration() * MICROSECONDS) as i64).into(),
);
map.insert(
"mpris:artUrl",
Value::new(
url::Url::from_file_path(audrey::globals::art_path())
.unwrap()
.to_string(),
)
.to_owned(),
(url::Url::from_file_path(audrey::globals::art_path())
.unwrap()
.to_string(),)
.into(),
);
map.insert("xesam:album", Value::new(song.album()));
map.insert("xesam:album", song.album().into());
// TODO: use the right opensubsonic data
map.insert("xesam:artist", Value::new(vec![song.artist()]));
map.insert("xesam:title", Value::new(song.title()));
map.insert("xesam:artist", vec![song.artist()].into());
map.insert("xesam:title", song.title().into());
}
map