>From c44cebcdc18f52610c042e668c7a0725726340bb Mon Sep 17 00:00:00 2001 From: "Arnel A. Borja" Date: Tue, 3 Sep 2013 21:28:45 +0800 Subject: [PATCH 3/4] notification: Fix crash if artist or album is unknown --- gnomemusic/notification.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnomemusic/notification.py b/gnomemusic/notification.py index 6c871cf..37ae712 100644 --- a/gnomemusic/notification.py +++ b/gnomemusic/notification.py @@ -75,10 +75,11 @@ class NotificationManager: self._notification.show() else: item = self._player.get_current_media() - artist = item.get_author() - if artist is None: - artist = item.get_string(Grl.METADATA_KEY_ARTIST) - album = item.get_string(Grl.METADATA_KEY_ALBUM) + artist = item.get_string(Grl.METADATA_KEY_ARTIST)\ + or item.get_author()\ + or _("Unknown Artist") + album = item.get_string(Grl.METADATA_KEY_ALBUM)\ + or _("Unknown Album") self._notification.update(item.get_title(), # TRANSLATORS: by refers to the artist, from to the album -- 1.8.3.1