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



commit a16e017e43119658344d549f211e5f3a234e577b
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]