[gnome-music/wip/jfelder/playlists-core-rewrite-prep-work: 3/24] playlists: Remove unecessary method clear_playlist



commit e060db706a636b8e78ff57c6929adbeb0346d49b
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Jul 2 14:20:36 2019 +0200

    playlists: Remove unecessary method clear_playlist
    
    The clear_playlist method is only used to clear a smart playlist
    before repopulating it. It does not need to be exposed:
    update_smart_playlist method can directly make the appropriate call.

 gnomemusic/playlists.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/gnomemusic/playlists.py b/gnomemusic/playlists.py
index 2599d940..8c67eee5 100644
--- a/gnomemusic/playlists.py
+++ b/gnomemusic/playlists.py
@@ -252,14 +252,11 @@ class Playlists(GObject.GObject):
 
     @log
     def update_smart_playlist(self, playlist):
-        """Given a smart playlist (subclass of SmartPlaylists),
-        updates according to its query."""
-        # Clear the playlist
-        self.clear_playlist(playlist)
+        """Updates a smart playlists.
 
-    @log
-    def clear_playlist(self, playlist):
-        """Starts cleaning the playlist"""
+        :param SmartPlaylist playlist: playlist to update
+        """
+        # Clear the smart playlist and then repopulate it
         query = Query.clear_playlist_with_id(playlist.ID)
         self._tracker.update_async(
             query, GLib.PRIORITY_LOW, None, self._smart_playlist_cleared_cb,


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