[gnome-music/wip/gbsneto/playlists: 1/3] 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: 1/3] playlists: handle grilo internally
- Date: Wed, 5 Oct 2016 12:39:47 +0000 (UTC)
commit e1d2443b20cad2eeb0ea5bf329392dd9dc6d3061
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/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 52fc9e6..f7ec082 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -1897,10 +1897,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]