From 97d3468392cfc3d6cc37f3b851e27fa1fe9f23d2 Mon Sep 17 00:00:00 2001 From: r4v3n6101 Date: Thu, 20 Aug 2020 18:12:47 +0300 Subject: [PATCH] Fix trackid replacing string with d-bus path --- src/mpris.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mpris.rs b/src/mpris.rs index afe60e4..e6d3206 100644 --- a/src/mpris.rs +++ b/src/mpris.rs @@ -38,7 +38,12 @@ fn get_metadata(playable: Option) -> Metadata { hm.insert( "mpris:trackid".to_string(), - Variant(Box::new(playable.map(|t| t.uri()).unwrap_or_default())), + Variant(Box::new(Path::from(format!( + "/org/ncspot/{}", + playable + .map(|t| t.uri().replace(':', "/")) + .unwrap_or("0".to_string()) + )))), ); hm.insert( "mpris:length".to_string(),