[gnome-music/freeze-break: 46/107] notification: Get current media directly from player



commit dc98eaa4ce8635dab9e421cbea79729791fdf312
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Tue Sep 3 21:22:38 2013 +0800

    notification: Get current media directly from player

 gnomemusic/notification.py |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gnomemusic/notification.py b/gnomemusic/notification.py
index d4c4ea5..dab99d4 100644
--- a/gnomemusic/notification.py
+++ b/gnomemusic/notification.py
@@ -66,16 +66,12 @@ class NotificationManager:
             self._update_track(self._player)
 
     def _update_track(self, player):
-        model = self._player.playlist
-        trackIter = self._player.currentTrack
-
-        if trackIter is None:
+        if not self._player.currentTrack:
             self._notification.update(_("Not playing"), None, 'gnome-music')
             self._notification.set_hint('image-data', None)
             self._notification.show()
         else:
-            trackField = self._player.playlistField
-            item = model.get_value(trackIter, trackField)
+            item = self._player.get_current_media()
             artist = item.get_author()
             if artist is None:
                 artist = item.get_string(Grl.METADATA_KEY_ARTIST)


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