[gnome-music/freeze-break: 47/107] notification: Fix crash if artist or album is unknown



commit 662515bb181c1d48da70ea26cd2c3726051b2a1d
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Tue Sep 3 21:28:45 2013 +0800

    notification: Fix crash if artist or album is unknown

 gnomemusic/notification.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/notification.py b/gnomemusic/notification.py
index dab99d4..01ec513 100644
--- a/gnomemusic/notification.py
+++ b/gnomemusic/notification.py
@@ -72,10 +72,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


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