[gnome-music/wip/mschraal/core] trackerresource: Better albums query



commit 052f828906de59957dfee1b171ce776e00e59e0b
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Jun 20 13:44:33 2019 +0200

    trackerresource: Better albums query
    
    Fill out the albums query a little better

 gnomemusic/grilowrappers/grltrackersource.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackersource.py b/gnomemusic/grilowrappers/grltrackersource.py
index 3d54a1ad..0463d4e2 100644
--- a/gnomemusic/grilowrappers/grltrackersource.py
+++ b/gnomemusic/grilowrappers/grltrackersource.py
@@ -169,12 +169,19 @@ class GrlTrackerSource(GObject.GObject):
         SELECT
             rdf:type(?album)
             tracker:id(?album) AS ?id
-            nmm:artistName(?album_artist) AS ?album_artist
-            nie:title(?album) as ?title
+            nie:title(?album) AS ?title
+            ?composer AS ?composer
+            ?album_artist AS ?album_artist
+            nmm:artistName(?performer) AS ?artist
+            YEAR(MAX(nie:contentCreated(?song))) AS ?creation_date
         {
             ?album a nmm:MusicAlbum .
-            OPTIONAL { ?album nmm:albumArtist ?albumArtist . }
-        }
+            ?song a nmm:MusicPiece ;
+                nmm:musicAlbum ?album ;
+                nmm:performer ?performer .
+            OPTIONAL { ?song nmm:composer/nmm:artistName ?composer . }
+            OPTIONAL { ?album nmm:albumArtist/nmm:artistName ?album_artist . }
+        } GROUP BY ?album
         """.replace('\n', ' ').strip()
 
         options = self._fast_options.copy()


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