Commit 6c321fca authored by Georges Basile Stavracas Neto's avatar Georges Basile Stavracas Neto Committed by Marinus Schraal

playlists: Handle grilo internally

There is no reason to delegate this to the view, and it also makes
the code less understandable.
parent 7057c0b9
......@@ -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."""
......
......@@ -404,10 +404,6 @@ class SearchView(BaseView):
def _filter_visible_func(self, model, _iter, data=None):
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 = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment