mirror of
https://github.com/powerline/powerline.git
synced 2025-07-23 05:46:01 +02:00
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:
commit
d36850f33d
@ -308,6 +308,17 @@ 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):
|
||||||
|
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(
|
return _get_dbus_player_status(
|
||||||
pl=pl,
|
pl=pl,
|
||||||
player_name='Spotify',
|
player_name='Spotify',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user