[gnome-music/wip/jfelder/playlist-add-songs-fix: 16/17] grltrackerplaylists: Do not add the same song several times
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/playlist-add-songs-fix: 16/17] grltrackerplaylists: Do not add the same song several times
- Date: Mon, 22 Mar 2021 13:39:27 +0000 (UTC)
commit f902e2cde114432af57eaf4ed4aef02958670439
Author: Jean Felder <jfelder src gnome org>
Date: Wed Feb 24 16:42:30 2021 +0100
grltrackerplaylists: Do not add the same song several times
When songs are added to a user playlist, a query is performed to
update the playlist and display the new songs. However, this query
inserts a new song several times if it was already part of the
playlist because it only filters the song id.
This issue is fixed by adding a limit of one to the query.
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 d4a2f0de9..c2909a5b7 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -651,7 +651,7 @@ class Playlist(GObject.GObject):
FILTER (
%(filter_clause_pl)s
)
- }
+ } LIMIT 1
""".replace("\n", " ").strip() % {
"media_type": int(Grl.MediaType.AUDIO),
"filter_clause_song": "tracker:id(?song) = " + media_id,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]