[gnome-music] mpris: Check media if None in _get_media_id



commit 252a06b9e4ec3590f01343449f96bcea4dbe96d3
Author: Arnel Borja <arnelborja src gnome org>
Date:   Sun Nov 23 21:58:53 2014 +0800

    mpris: Check media if None in _get_media_id
    
    Parameter media is None when there is no playlist and tracklist was
    requested via the TrackList interface.

 gnomemusic/mpris.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index d1b4723..0064a61 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -191,7 +191,8 @@ class MediaPlayer2Service(dbus.service.Object):
 
     @log
     def _get_media_id(self, media):
-        return '/org/mpris/MediaPlayer2/Track/%s' % media.get_id()
+        return '/org/mpris/MediaPlayer2/TrackList/%s' % \
+            (media.get_id() if media else 'NoTrack')
 
     @log
     def _get_media_from_id(self, track_id):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]