[gnome-music] view: Fix crash when artist is unknown
- From: Arnel A. Borja <arnelborja src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] view: Fix crash when artist is unknown
- Date: Mon, 2 Sep 2013 16:18:19 +0000 (UTC)
commit 9aa86fd0d31099d5a61ffa0e5375dd01ad1bf616
Author: Arnel A. Borja <arnelborja src gnome org>
Date: Mon Sep 2 22:55:20 2013 +0800
view: Fix crash when artist is unknown
https://bugzilla.gnome.org/show_bug.cgi?id=705855
gnomemusic/view.py | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 8399ee8..b5622c4 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -354,12 +354,14 @@ class Songs(ViewContainer):
return
self._offset += 1
item.set_title(albumArtCache.get_media_title(item))
+ artist = item.get_string(Grl.METADATA_KEY_ARTIST)\
+ or item.get_author()\
+ or _("Unknown Artist")
_iter = self._model.insert_with_valuesv(
-1,
[2, 3, 5, 8, 9, 10],
[albumArtCache.get_media_title(item),
- item.get_string(Grl.METADATA_KEY_ARTIST),
- item, self.nowPlayingIconName, False, False])
+ artist, item, self.nowPlayingIconName, False, False])
self.player.discover_item(item, self._on_discovered, _iter)
g_file = Gio.file_new_for_uri(item.get_url())
self.monitors.append(g_file.monitor_file(Gio.FileMonitorFlags.NONE,
@@ -565,11 +567,9 @@ class Artists (ViewContainer):
if item is None:
return
self._offset += 1
- artist = item.get_string(Grl.METADATA_KEY_ARTIST)
- if not artist:
- artist = item.get_author()
- if not artist:
- artist = _("Unknown Artist")
+ artist = item.get_string(Grl.METADATA_KEY_ARTIST)\
+ or item.get_author()\
+ or _("Unknown Artist")
if not artist.lower() in self._artists:
_iter = self._model.insert_with_valuesv(-1, [2], [artist])
self._artists[artist.lower()] = {'iter': _iter, 'albums': []}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]