Commit Graph

1 Commits

Author SHA1 Message Date
Denis cd4a8a797b Fix MPRIS player detection: browsers, relaunched and slow players
Players were silently lost, so the Playing tab showed no controls:

- Chromium and Brave answer MPRIS calls but return an empty introspection,
  which made dbus-next fail with "interface not found". The MPRIS interfaces
  are now described statically (MPRIS 2 spec) instead of read from the player.
- A player relaunched under the same bus name (Dragon Player, Celluloid...)
  left its old object subscribed to PropertiesChanged; that signal cancelled
  the pending attach of the new one. Player.close() now unsubscribes.
- A player may take its name long before it answers (objects exported later,
  or a main loop busy opening a file read over the network). Attaching is now
  retried while the name stays on the bus, with a per-attempt timeout, and is
  cancelled when the player leaves. MprisManager.stop() cancels everything.

tests/test_mpris.py runs on a private dbus-daemon and covers each case; the
relaunch, empty-introspection and late-player tests fail without the fixes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 16:28:08 +01:00