[gnome-music/wip/gbsneto/playlists-3-22: 1/3] playlists: handle grilo internally



commit 3add6aeb3bbc447e44b444a7c997e7b860c68f9c
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Oct 7 11:22:32 2016 -0300

    playlists: handle grilo internally
    
    There is no reason to delegate this to the view, and it also makes
    the code less understandable.

 gnomemusic/playlists.py |    6 ++++++
 gnomemusic/view.py      |    4 ----
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/playlists.py b/gnomemusic/playlists.py
index 7fb6d25..77158e1 100644
--- a/gnomemusic/playlists.py
+++ b/gnomemusic/playlists.py
@@ -121,6 +121,12 @@ class Playlists(GObject.GObject):
         self.tracker = TrackerWrapper().tracker
         StaticPlaylists()
 
+        grilo.connect('ready', self._on_grilo_ready)
+
+    @log
+    def _on_grilo_ready(self, data=None):
+        self.fetch_or_create_static_playlists()
+
     @log
     def fetch_or_create_static_playlists(self):
         """For all static playlists: get ID, if exists; if not, create the playlist and get ID."""
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index d83aa41..a027f68 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -1864,10 +1864,6 @@ class Search(ViewContainer):
         return model.iter_parent(_iter) is not None or model.iter_has_child(_iter)
 
     @log
-    def _on_grilo_ready(self, data=None):
-        playlists.fetch_or_create_static_playlists()
-
-    @log
     def set_search_text(self, search_term, fields_filter):
         query_matcher = {
             'album': {


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