[gnome-music/wip/bug726721_debug] simplify set_view_filter: don't re-read media's artist and album



commit 65413c4e2422b75f109c41985d2f877e0e966ab4
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Thu Mar 27 17:04:55 2014 +0100

    simplify set_view_filter: don't re-read media's artist and album

 gnomemusic/searchbar.py |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/gnomemusic/searchbar.py b/gnomemusic/searchbar.py
index b426ea2..988ecc6 100644
--- a/gnomemusic/searchbar.py
+++ b/gnomemusic/searchbar.py
@@ -27,19 +27,10 @@ class Searchbar(Gd.Revealer):
         if self._search_entry.get_property("visible"):
             search_string = self._search_entry.get_text().lower()
             media = model.get_value(itr, 5)
-            searchable_fields = []
-            artist = _("Unknown Artist")
-            album = _("Unknown Album")
+            searchable_fields = [model.get_value(itr, 2),
+                                 model.get_value(itr, 3)]
             if media and media.get_url():
-                print("media is %s with url %s" % (media, media.get_url()))
-                if media.get_artist() is not None:
-                    artist = media.get_artist()
-                if media.get_album() is not None:
-                    album = media.get_album()
-                searchable_fields = [artist, album, media.get_title()]
-            else:
-                searchable_fields = [model.get_value(itr, 2),
-                                     model.get_value(itr, 3)]
+                searchable_fields.append(media.get_title())
             for field in searchable_fields:
                 if field and search_string in field.lower():
                     return True


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