[gnome-music/wip/jfelder/playlists-fixes: 6/8] grltrackerplaylists: Correctly add songs to user playlists
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/playlists-fixes: 6/8] grltrackerplaylists: Correctly add songs to user playlists
- Date: Thu, 12 Sep 2019 14:23:18 +0000 (UTC)
commit 0663f720f5b3cbd08b15351dcd18cdc91d845894
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.
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 0e024ec7..c12fc7cd 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -560,7 +560,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]