Merge pull request #1893 from StopMotionCuber/1754-spotify-new-dbus-protocol

(fix) updated spotify segment to support both new and old protocol

Closes #1870
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2018-03-16 01:07:41 +03:00 committed by GitHub
commit d36850f33d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -308,6 +308,17 @@ Requires ``dbus`` python module. Only for players that support specific protocol
class SpotifyDbusPlayerSegment(PlayerSegment):
def get_player_status(self, pl):
player_status = _get_dbus_player_status(
pl=pl,
player_name='Spotify',
bus_name='org.mpris.MediaPlayer2.spotify',
player_path='/org/mpris/MediaPlayer2',
iface_prop='org.freedesktop.DBus.Properties',
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',