fix: do not announce unplayable tracks via mpris

fixes #349
This commit is contained in:
Henrik Friedrichsen
2020-12-19 00:28:39 +01:00
parent 5ce396f0c9
commit 5671f1e5a4
2 changed files with 3 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ fn get_metadata(playable: Option<Playable>) -> Metadata {
Variant(Box::new(Path::from(format!(
"/org/ncspot/{}",
playable
.filter(|t| t.id().is_some())
.map(|t| t.uri().replace(':', "/"))
.unwrap_or_else(|| String::from("0"))
)))),