1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-07 14:08:29 -04:00

refactor(mpris): consolidate equivalent-player resolution & update track matching

Port 1.5
This commit is contained in:
purian23
2026-08-02 18:09:18 -04:00
parent 594a2cde19
commit 19d919ed5c
3 changed files with 31 additions and 23 deletions
+3 -7
View File
@@ -59,11 +59,8 @@ Singleton {
if (directUrl !== "")
return directUrl;
const equivalent = MprisController.availablePlayers.find(candidate => {
return candidate !== player
&& candidate.playbackState !== MprisPlaybackState.Stopped
&& MprisController.isSameTrack(player, candidate)
&& _directArtworkUrl(candidate) !== "";
const equivalent = MprisController.equivalentPlayers(player).find(candidate => {
return candidate !== player && _directArtworkUrl(candidate) !== "";
});
return _directArtworkUrl(equivalent);
}
@@ -229,8 +226,7 @@ Singleton {
}
_pendingArtKey = key;
const url = getArtworkUrl(activePlayer);
// Ignore duplicate notifications, but allow a richer peer to replace
// the artwork for the same canonical track.
// Ignore duplicate notifications, but let a richer peer replace same-track art
if (key !== "" && key === _committedArtKey && url === _committedSrcUrl)
return;
if (key !== "" && url !== "" && url === _committedSrcUrl) {