[gnome-music/wip/jfelder/playlists-core-rewrite-prep-work: 6/9] grilo: Remove unused function populate_playlists



commit 16b81888c17b77cd8be5daf334b76a1077c9e3a6
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Jul 2 10:39:47 2019 +0200

    grilo: Remove unused function populate_playlists
    
    populate_playlists was used to retrieve all the playlists (smart
    playlists and playlists created by the user). The only consumer of
    this funtion was MPRIS which now uses the playlists queried by the
    Playlists class.
    
    Playlists class uses a combination of populate_user_playlists (to
    retrieve user playlists) and direct tracker calls to get all the
    playlists. The tracker calls are necessary because the smart playlists
    need to be created if they don't already exist.

 gnomemusic/grilo.py | 12 ------------
 gnomemusic/query.py |  5 -----
 2 files changed, 17 deletions(-)
---
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index 9b26dbd4..6120599d 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -289,18 +289,6 @@ class Grilo(GObject.GObject):
     def populate_songs(self, offset, callback, count=-1):
         self.populate_items(Query.all_songs(), offset, callback, count)
 
-    @log
-    def populate_playlists(self, offset, callback, count=-1, data=None):
-        """Asynchronously get playlists (user and smart ones)
-
-        :param int offset: start index
-        :param function callback: callback function
-        :param int count: limit number of results
-        :param object data: user data
-        """
-        self.populate_items(
-            Query.all_playlists(), offset, callback, count, data)
-
     @log
     def populate_user_playlists(self, offset, callback, count=-1):
         """Asynchronously get user playlists
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 8415711e..6024a6a0 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -89,11 +89,6 @@ class Query():
     def all_songs():
         return Query.songs('?song a nmm:MusicPiece ; a nfo:FileDataObject .')
 
-    @staticmethod
-    def all_playlists():
-        """Query to retrieve all playlists (user and smart ones)."""
-        return Query.playlists('?playlist a nmm:Playlist .')
-
     @staticmethod
     def all_user_playlists():
         """Query to retrieve playlists created by user."""


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