[gnome-music] query: Fix coverart retrieval



commit 71f58eb32fd5298c13f31f4ea8b7caec79e37f20
Author: Marinus Schraal <mschraal src gnome org>
Date:   Sun Sep 11 22:04:43 2016 +0200

    query: Fix coverart retrieval
    
    With the introduction of album_artist in commit 17de084 I went a bit
    too far, since the Grilo cover art plugins only use artist for
    retrieval. Have those queries return an artist key instead.

 gnomemusic/query.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 0fb96a7..4611d85 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -342,6 +342,9 @@ class Query():
 
     @staticmethod
     def get_album_for_album_id(album_id):
+        # Even though we check for the album_artist, we fill
+        # the artist key, since Grilo coverart plugins use
+        # only that key for retrieval.
         query = """
     SELECT DISTINCT
         rdf:type(?album)
@@ -353,7 +356,7 @@ class Query():
                 ?album nmm:albumArtist ?album_artist
             }
             LIMIT 1
-        ) AS ?album_artist
+        ) AS ?artist
         nie:title(?album) AS ?title
         nie:title(?album) AS ?album
     WHERE {
@@ -370,6 +373,7 @@ class Query():
 
     @staticmethod
     def get_album_for_song_id(song_id):
+        # See get_album_for_album_id comment.
         query = """
     SELECT DISTINCT
         rdf:type(?album)
@@ -381,7 +385,7 @@ class Query():
                 ?album nmm:albumArtist ?album_artist
             }
             LIMIT 1
-        ) AS ?album_artist
+        ) AS ?artist
         nie:title(?album) AS ?title
         nie:title(?album) AS ?album
     WHERE {


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