Merge pull request #338 from grimpy/fix_nowplaying
now_playing: use get_dbus_method for compatibility
This commit is contained in:
commit
c35eb5ee3b
@ -69,7 +69,9 @@ class NowPlaying(IntervalModule):
|
|||||||
old_player = None
|
old_player = None
|
||||||
|
|
||||||
def find_player(self):
|
def find_player(self):
|
||||||
players = [a for a in dbus.SessionBus().get_object("org.freedesktop.DBus", "/org/freedesktop/DBus").ListNames() if a.startswith("org.mpris.MediaPlayer2.")]
|
obj = dbus.SessionBus().get_object("org.freedesktop.DBus", "/org/freedesktop/DBus")
|
||||||
|
method = obj.get_dbus_method('ListNames', 'org.freedesktop.DBus')
|
||||||
|
players = [a for a in method() if a.startswith("org.mpris.MediaPlayer2.")]
|
||||||
if self.old_player in players:
|
if self.old_player in players:
|
||||||
return self.old_player
|
return self.old_player
|
||||||
if not players:
|
if not players:
|
||||||
|
Loading…
Reference in New Issue
Block a user