[gnome-music] query: Don't assume that nmm:MusicPieces will have a nie:url in playlists



commit fd609d83d895e4cb8167f21be848852252f04918
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 7 22:52:17 2016 +0100

    query: Don't assume that nmm:MusicPieces will have a nie:url in playlists
    
    nmm:MusicPieces may have an indirect relation to the nfo:FileDataObject
    and its nie:url, expressed through the nie:isStoredAs relationship. As
    such, poking the nie:url of nmm:MusicPieces themselves may bring these
    queries to bring 0 results unexpectedly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763304

 gnomemusic/query.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index b882fb7..67f81b6 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -711,7 +711,7 @@ class Query():
           ?as nie:url ?url .
           FILTER (
             tracker:uri-is-descendant(
-              '%(music_dir)s', nie:url(?song)
+              '%(music_dir)s', ?url
             )
           )
         } ORDER BY DESC(?count) LIMIT 50
@@ -732,7 +732,7 @@ class Query():
             FILTER ( NOT EXISTS { ?song nie:usageCounter ?count .} )
             FILTER (
             tracker:uri-is-descendant(
-                '%(music_dir)s', nie:url(?song)
+                '%(music_dir)s', ?url
             )
         )
         } ORDER BY nfo:fileLastAccessed(?song) LIMIT 50
@@ -763,7 +763,7 @@ class Query():
                 FILTER ( EXISTS { ?song nie:usageCounter ?count .} )
                 FILTER (
                   tracker:uri-is-descendant(
-                    '%(music_dir)s', nie:url(?song)
+                    '%(music_dir)s', ?url
                   )
                 )
             } ORDER BY DESC(?last_played) LIMIT 50
@@ -795,7 +795,7 @@ class Query():
             FILTER ( ?added > '%(compare_date)s'^^xsd:dateTime )
             FILTER (
               tracker:uri-is-descendant(
-                '%(music_dir)s', nie:url(?song)
+                '%(music_dir)s', ?url
               )
             )
         } ORDER BY DESC(?added) LIMIT 50
@@ -817,7 +817,7 @@ class Query():
         ?as nie:url ?url .
         FILTER (
           tracker:uri-is-descendant(
-            '%(music_dir)s', nie:url(?song)
+            '%(music_dir)s', nie:url(?as)
           )
         )
     } ORDER BY DESC(tracker:added(?song))


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