[gnome-music/wip/gbsneto/playlists: 5/7] playlists: handle grilo internally
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/gbsneto/playlists: 5/7] playlists: handle grilo internally
- Date: Fri, 7 Oct 2016 14:05:15 +0000 (UTC)
commit af0fbb16b4f40822f742007badb4b174f08f84a9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Oct 4 10:22:38 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/views/searchview.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/views/searchview.py b/gnomemusic/views/searchview.py
index 4b31e1f..8a030b6 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -405,10 +405,6 @@ class SearchView(BaseView):
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]