[gnome-music/wip/mschraal/tageditor-13feb2020: 8/25] grltrackerwrapper: Retrieve album artist for songs



commit f2a4989150ef29841e6c6d09dbb2fa4b402f9fe1
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Jan 22 18:06:24 2020 +0100

    grltrackerwrapper: Retrieve album artist for songs

 gnomemusic/grilowrappers/grltrackerwrapper.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 15b7e3e8..b3d99a6a 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -309,6 +309,7 @@ class GrlTrackerWrapper(GObject.GObject):
             nie:title(?song) AS ?title
             nmm:artistName(nmm:performer(?song)) AS ?artist
             nie:title(nmm:musicAlbum(?song)) AS ?album
+            ?album_artist AS ?album_artist
             nfo:duration(?song) AS ?duration
             nie:usageCounter(?song) AS ?play_count
             nmm:trackNumber(?song) AS ?track_number
@@ -328,6 +329,10 @@ class GrlTrackerWrapper(GObject.GObject):
                 ?track_id tracker:referenceSource
                     "https://musicbrainz.org/doc/Track"; .
             }
+            OPTIONAL {
+                ?song nmm:musicAlbum ?album .
+                ?album nmm:albumArtist/nmm:artistName ?album_artist .
+            }
             OPTIONAL {
                 ?song nao:hasTag ?tag .
                 FILTER (?tag = nao:predefined-tag-favorite)
@@ -403,6 +408,7 @@ class GrlTrackerWrapper(GObject.GObject):
             nie:title(?song) AS ?title
             nmm:artistName(nmm:performer(?song)) AS ?artist
             nie:title(nmm:musicAlbum(?song)) AS ?album
+            ?album_artist AS ?album_artist
             nfo:duration(?song) AS ?duration
             nie:usageCounter(?song) AS ?play_count
             nmm:trackNumber(?song) AS ?track_number
@@ -422,6 +428,10 @@ class GrlTrackerWrapper(GObject.GObject):
                 ?track_id tracker:referenceSource
                     "https://musicbrainz.org/doc/Track"; .
             }
+            OPTIONAL {
+                ?song nmm:musicAlbum ?album .
+                ?album nmm:albumArtist/nmm:artistName ?album_artist .
+            }
             OPTIONAL {
                 ?song nao:hasTag ?tag .
                 FILTER (?tag = nao:predefined-tag-favorite)
@@ -668,6 +678,7 @@ class GrlTrackerWrapper(GObject.GObject):
             nie:title(?song) AS ?title
             nmm:artistName(nmm:performer(?song)) AS ?artist
             nie:title(nmm:musicAlbum(?song)) AS ?album
+            ?album_artist AS ?album_artist
             nfo:duration(?song) AS ?duration
             nmm:trackNumber(?song) AS ?track_number
             nmm:setNumber(nmm:musicAlbumDisc(?song)) AS ?album_disc_number
@@ -688,6 +699,7 @@ class GrlTrackerWrapper(GObject.GObject):
                 ?track_id tracker:referenceSource
                     "https://musicbrainz.org/doc/Track"; .
             }
+            OPTIONAL { ?album nmm:albumArtist/nmm:artistName ?album_artist . }
             OPTIONAL { ?song nao:hasTag ?tag .
                        FILTER (?tag = nao:predefined-tag-favorite) } .
             FILTER ( tracker:id(?album) = %(album_id)s


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