mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-22 13:32:42 +01:00
add trackid
- mpris important property (maybe needed sometime)
This commit is contained in:
parent
a2a2023853
commit
b2e68f5a8f
@ -300,6 +300,7 @@ function updateMediaInfo(options, notify) {
|
|||||||
"xesam:album": options.album,
|
"xesam:album": options.album,
|
||||||
"mpris:artUrl": options.image,
|
"mpris:artUrl": options.image,
|
||||||
"mpris:length": convertDuration(options.duration) * 1000 * 1000,
|
"mpris:length": convertDuration(options.duration) * 1000 * 1000,
|
||||||
|
"mpris:trackid": "/org/mpris/MediaPlayer2/track/" + getTrackID(),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
player.playbackStatus = options.status == statuses.paused ? "Paused" : "Playing";
|
player.playbackStatus = options.status == statuses.paused ? "Paused" : "Playing";
|
||||||
@ -321,6 +322,16 @@ function getTrackURL() {
|
|||||||
return window.location;
|
return window.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getTrackID() {
|
||||||
|
const URLelement = elements.get("title").querySelector("a");
|
||||||
|
if (URLelement !== null) {
|
||||||
|
const id = URLelement.href.replace(/[^0-9]/g, "");
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
return window.location;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Watch for song changes and update title + notify
|
* Watch for song changes and update title + notify
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user