From ccbe67dea24629e9b5a268da05cc31424c2e80e2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 12 Sep 2026 11:27:20 +0200 Subject: fix(volume-osd): drop the plasma-browser-integration duplicate too playerctld was not the only proxy. plasma-browser-integration republishes a browser tab under its own bus name, so a playing Navidrome tab in Firefox was live on three names at once: firefox.instance_*, the plasma name, and playerctld. Only the first was being filtered, so two entries survived for one track and the transport buttons went to whichever sorted first. Safe to drop because none of the three bus names exists until playback starts, and the browser's own entry was present whenever the plasma one was, measured across two play sessions. An open but silent tab publishes nothing, so there is no row to lose. Also records what Navidrome does not provide: no mpris:artUrl, which is why the row shows no cover and is not a bug on this side, and everything packed into xesam:title with xesam:artist left empty. Neither is worked around, splitting such a title needs guessing where a real dash ends. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01TvHeJEXJzdfAaCCYqURAWp --- volume-osd/Player.qml | 14 ++++++++++---- volume-osd/README.md | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/volume-osd/Player.qml b/volume-osd/Player.qml index 73f86af..7c17c0a 100644 --- a/volume-osd/Player.qml +++ b/volume-osd/Player.qml @@ -19,11 +19,17 @@ import QtQuick Singleton { id: root - // playerctld proxies whatever is playing and publishes it under its own - // name, so every real player shows up twice. Its own entry is skipped: - // controlling the player directly works whether or not playerctld is up. + // Two things proxy a real player and republish it under their own name, so + // one track can appear on three buses at once: a playing Navidrome tab + // showed up as firefox.instance_*, as plasma-browser-integration and as + // playerctld. Both proxies are skipped and the OSD talks to the browser's + // own entry, which is safe because none of the three exists until playback + // starts, and the browser's entry appeared whenever the plasma one did. An + // open but silent tab publishes nothing, so there is no row to lose. + readonly property var proxyNames: [".playerctld", ".plasma-browser-integration"] + readonly property var real: - Mpris.players.values.filter(p => !p.dbusName.endsWith(".playerctld")) + Mpris.players.values.filter(p => !root.proxyNames.some(n => p.dbusName.endsWith(n))) // Prefer something actually playing; otherwise keep the last one seen, so // pausing does not make the track row vanish mid-look. diff --git a/volume-osd/README.md b/volume-osd/README.md index 950edca..83a9495 100644 --- a/volume-osd/README.md +++ b/volume-osd/README.md @@ -35,19 +35,24 @@ there was anything clickable on it. It still takes no keyboard focus. Two things about MPRIS that are not obvious: -**playerctld publishes a duplicate.** It proxies whichever player is active -and republishes the metadata under `org.mpris.MediaPlayer2.playerctld`, so -every player appears twice. `Player.qml` drops that name and talks to the real -player, which works whether or not playerctld is running. +**Proxies publish duplicates.** playerctld proxies whichever player is +active and republishes it under `org.mpris.MediaPlayer2.playerctld`. With a +browser, plasma-browser-integration does the same, so one Navidrome tab was +live on three bus names at once. `Player.qml` drops both proxies and talks to +the browser's own entry. None of the three exists until playback starts, and +an open but silent tab publishes nothing at all. **Album art can be a reused temp path.** Audacious extracts embedded art to a file in its cache and rewrites that same path on each track, so the URL repeats while the image behind it changes. The source carries the track title as a cache buster and `cache: false`, or the previous track's cover stays on screen. -Verified against audacious and Firefox. Firefox is the interesting one: a tab -per stream, all under one bus name, which is where the playerctld filter above -would show up if it were wrong. Signal is untested. +Verified against audacious and Firefox playing Navidrome. Browsers do not +fill in everything: Navidrome sets no `mpris:artUrl`, so there is no cover to +show and the row renders without one, and it packs everything into +`xesam:title` ("Roxanne - The Police - Navidrome") leaving `xesam:artist` +empty. Neither is worked around, a title like that cannot be split back apart +without guessing where a real dash ends. Signal is untested. ## No keybinds to change -- cgit v1.2.3