[gnome-music: 2/4] view: Don't get author of item if artist key is available



commit ef9448199a6edcea715806199c29cfcf3ccf6524
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Fri Jul 26 21:51:03 2013 +0800

    view: Don't get author of item if artist key is available
    
    Also, show "Unknown Artist" instead of "Unknown" if the artist's and
    author's name is not available, and mark it as translatable.

 gnomemusic/view.py |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index a35be43..3942952 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -167,11 +167,11 @@ class ViewContainer(Gtk.Stack):
         if item:
             self._offset += 1
             _iter = self._model.append()
-            artist = "Unknown"
-            if item.get_author():
+            artist = item.get_string(Grl.METADATA_KEY_ARTIST)
+            if not artist:
                 artist = item.get_author()
-            if item.get_string(Grl.METADATA_KEY_ARTIST):
-                artist = item.get_string(Grl.METADATA_KEY_ARTIST)
+            if not artist:
+                artist = _("Unknown Artist")
             title = albumArtCache.get_media_title(item)
             item.set_title(title)
             try:
@@ -498,15 +498,17 @@ class Artists (ViewContainer):
         self._offset += 1
         if item is None:
             return
-        artist = "Unknown"
-        if item.get_author():
+        artist = item.get_string(Grl.METADATA_KEY_ARTIST)
+        if not artist:
             artist = item.get_author()
-        if item.get_string(Grl.METADATA_KEY_ARTIST):
-            artist = item.get_string(Grl.METADATA_KEY_ARTIST)
+        if not artist:
+            artist = _("Unknown Artist")
         if not artist.lower() in self._artists:
             _iter = self._model.append()
             self._artists[artist.lower()] = {"iter": _iter, "albums": []}
-            self._model.set(_iter, 2, artist)
+            print('set 6')
+            self._model.set(_iter, [2], [artist])
+            print('set 6 end')
 
         self._artists[artist.lower()]["albums"].append(item)
 


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