Spotify segment checks for new protocol first
This commit is contained in:
parent
cc965526fb
commit
74c08cd538
|
@ -308,17 +308,7 @@ Requires ``dbus`` python module. Only for players that support specific protocol
|
||||||
|
|
||||||
class SpotifyDbusPlayerSegment(PlayerSegment):
|
class SpotifyDbusPlayerSegment(PlayerSegment):
|
||||||
def get_player_status(self, pl):
|
def get_player_status(self, pl):
|
||||||
legacy_player_status = _get_dbus_player_status(
|
player_status = _get_dbus_player_status(
|
||||||
pl=pl,
|
|
||||||
player_name='Spotify',
|
|
||||||
bus_name='com.spotify.qt',
|
|
||||||
player_path='/',
|
|
||||||
iface_prop='org.freedesktop.DBus.Properties',
|
|
||||||
iface_player='org.freedesktop.MediaPlayer2',
|
|
||||||
)
|
|
||||||
if legacy_player_status is not None:
|
|
||||||
return legacy_player_status
|
|
||||||
return _get_dbus_player_status(
|
|
||||||
pl=pl,
|
pl=pl,
|
||||||
player_name='Spotify',
|
player_name='Spotify',
|
||||||
bus_name='org.mpris.MediaPlayer2.spotify',
|
bus_name='org.mpris.MediaPlayer2.spotify',
|
||||||
|
@ -326,6 +316,17 @@ class SpotifyDbusPlayerSegment(PlayerSegment):
|
||||||
iface_prop='org.freedesktop.DBus.Properties',
|
iface_prop='org.freedesktop.DBus.Properties',
|
||||||
iface_player='org.mpris.MediaPlayer2.Player',
|
iface_player='org.mpris.MediaPlayer2.Player',
|
||||||
)
|
)
|
||||||
|
if player_status is not None:
|
||||||
|
return player_status
|
||||||
|
# Fallback for legacy spotify client with different DBus protocol
|
||||||
|
return _get_dbus_player_status(
|
||||||
|
pl=pl,
|
||||||
|
player_name='Spotify',
|
||||||
|
bus_name='com.spotify.qt',
|
||||||
|
player_path='/',
|
||||||
|
iface_prop='org.freedesktop.DBus.Properties',
|
||||||
|
iface_player='org.freedesktop.MediaPlayer2',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
spotify_dbus = with_docstring(SpotifyDbusPlayerSegment(),
|
spotify_dbus = with_docstring(SpotifyDbusPlayerSegment(),
|
||||||
|
|
Loading…
Reference in New Issue