[gnome-music/wip/jfelder/playlists-fixes-simple-3.34: 1/2] grltrackerplaylists: Correctly add songs to user playlists



commit d5faba62726965730ce352ff31fd0a5086017523
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Sep 6 13:55:54 2019 +0200

    grltrackerplaylists: Correctly add songs to user playlists
    
    When adding songs to a user playlist, there are two steps:
    1. Insert the songs in the playlist (update Tracker database)
    2. Query these songs to add them to the playlist's model (and thus
    display them in GNOME Music)
    
    The second step always fails because the filter clause uses the wrong
    media id. Indeed, there are two ids to consider: the id of the song
    and the id of the entry in the playlist. The filter clause fails
    because it uses the id of the entry instead of the id of the song.
    
    Fix the issue by using the song id.
    
    (cherry picked from commit 5cd3c0e6668caabae76b51ea5f5b30715e2705a8)

 gnomemusic/grilowrappers/grltrackerplaylists.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index 364049c9..12db8b4e 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -570,7 +570,7 @@ class Playlist(GObject.GObject):
                 )
             }
             """.replace("\n", " ").strip() % {
-                "filter_clause": "tracker:id(?entry) = " + media_id}
+                "filter_clause": "tracker:id(?song) = " + media_id}
             options = self._fast_options.copy()
             self._source.query(
                 query, self.METADATA_KEYS, options, _add_to_model)


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