From ce71f40f7dfae8dd3f4fa8fcff5e7e0f88eb2200 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer <js@webkeks.org> Date: Wed, 22 Jul 2009 00:13:28 +0200 Subject: [PATCH] [Florian Zeitz] More compatibility for MPRIS. --- src/music_track_listener.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/music_track_listener.py b/src/music_track_listener.py index a833d8c609..a54a0670cd 100644 --- a/src/music_track_listener.py +++ b/src/music_track_listener.py @@ -130,10 +130,16 @@ class MusicTrackListener(gobject.GObject): return info def _mpris_playing_changed_cb(self, playing): - if playing: - self.emit('music-track-changed', None) - else: - self.emit('music-track-changed', self._last_playing_music) + if type(playing) is dbus.Struct: + if playing[0]: + self.emit('music-track-changed', None) + else: + self.emit('music-track-changed', self._last_playing_music) + else: # Workaround for e.g. Audacious + if playing: + self.emit('music-track-changed', None) + else: + self.emit('music-track-changed', self._last_playing_music) def _mpris_music_track_change_cb(self, arg): self._last_playing_music = self._mpris_properties_extract(arg) -- GitLab