>From 6647f0cab64879b0e9f9ff4de9e34f5c8cd7b019 Mon Sep 17 00:00:00 2001 From: "Arnel A. Borja" Date: Tue, 3 Sep 2013 21:22:38 +0800 Subject: [PATCH 2/4] notification: Get current media directly from player --- gnomemusic/notification.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gnomemusic/notification.py b/gnomemusic/notification.py index 6f65090..6c871cf 100644 --- a/gnomemusic/notification.py +++ b/gnomemusic/notification.py @@ -68,15 +68,13 @@ class NotificationManager: 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) -- 1.8.3.1