The mpris_name passed to MprisPlayer::new is currently just crate::APP_ID, but this string is actually meant for use as the DBus name of the service, and cannot contain things such as ..
To Reproduce
Launch netease-cloud-music-gtk4
Launch osdlyrics
osdlyrics says no supported player found
Expected behavior
osdlyrics should be able to detect the netease-cloud-music-gtk instance.
Screenshots
n/a, but running osdlyrics-daemon gave very useful backtrace:
$ osdlyrics-daemon
WARNING:root:Cannot activate proxy org.osdlyrics.PlayerProxy.Mpd: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.osdlyrics.PlayerProxy.Mpd exited with status 1
ERROR:root:BugReport
Traceback (most recent call last):
File "/usr/lib64/osdlyrics/daemon/player.py", line 120, in _connect_player
path = proxy.ConnectPlayer(player_info['name'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/dbus/proxies.py", line 141, in __call__
return self._connection.call_blocking(self._named_service,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/dbus/connection.py", line 634, in call_blocking
reply_message = self.send_message_with_reply_and_block(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.ValueError: Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/dbus/service.py", line 712, in _message_cb
retval = candidate_method(self, *args, **keywords)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/osdlyrics/player_proxy.py", line 115, in ConnectPlayer
player = self.do_connect_player(player_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/osdlyrics/players/mpris2/mpris2.py", line 79, in do_connect_player
player = Mpris2Player(self, player_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/osdlyrics/players/mpris2/mpris2.py", line 85, in __init__
super().__init__(proxy, player_name)
File "/usr/lib/python3.11/site-packages/osdlyrics/player_proxy.py", line 253, in __init__
super().__init__(conn=proxy.connection,
File "/usr/lib/python3.11/site-packages/osdlyrics/dbusext/service.py", line 92, in __init__
dbus.service.Object.__init__(self, conn=conn,
File "/usr/lib/python3.11/site-packages/dbus/service.py", line 460, in __init__
validate_object_path(object_path)
ValueError: Invalid object path '/org/osdlyrics/PlayerProxy/Mpris2/com.gitee.gmg137.NeteaseCloudMusicGtk4': contains invalid character '.'
Desktop (please complete the following information):
OS: Gentoo
Browser: Firefox Nightly
Version: n/a
Additional context
This seems a wart introduced by the v2.0 mega update. Previously the mpris_name is just NeteaseCloudMusic.
Describe the bug
如题
The
mpris_name
passed toMprisPlayer::new
is currently justcrate::APP_ID
, but this string is actually meant for use as the DBus name of the service, and cannot contain things such as.
.To Reproduce
netease-cloud-music-gtk4
osdlyrics
osdlyrics
says no supported player foundExpected behavior
osdlyrics
should be able to detect thenetease-cloud-music-gtk
instance.Screenshots
n/a, but running
osdlyrics-daemon
gave very useful backtrace:Desktop (please complete the following information):
Additional context
This seems a wart introduced by the v2.0 mega update. Previously the
mpris_name
is justNeteaseCloudMusic
.