[gnome-music] query: Include playlists from Music dir only



commit 70ec3bda7ce890f0703965f8fff811a11436a5d0
Author: Marinus Schraal <mschraal src gnome org>
Date:   Wed Feb 3 13:20:29 2016 +0100

    query: Include playlists from Music dir only
    
    Tracker queries erroneously included playlist from outside the Music
    directory. Fix the query to only include playlists from the Music
    directory.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761502

 gnomemusic/query.py |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 67f81b6..28db88a 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -234,12 +234,10 @@ class Query():
         nfo:entryCounter(?playlist) AS ?childcount
         {
             %(where_clause)s
-            ?playlist a nmm:Playlist .
-            OPTIONAL {
-                ?playlist nie:url ?url ;
-                          tracker:available true .
-            FILTER (STRSTARTS (?url, '%(music_dir)s/'))
-            }
+            OPTIONAL { ?playlist nie:url ?url;
+                       tracker:available ?available . }
+            FILTER ( (STRSTARTS(?url, '%(music_dir)s/') && ?available)
+                      || !BOUND(nfo:belongsToContainer(?playlist)) )
         }
     ORDER BY LCASE(?title)
     '''.replace('\n', ' ').strip() % {


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