[gnome-music/wip/jfelder/grilo-theaudiodb: 3/3] query: Make coverart queries more lenient



commit 72e493ad1f6ff57a7846cf564c33c5cc05d83c15
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Sep 2 23:55:24 2018 +0200

    query: Make coverart queries more lenient
    
    Coverart Tracker queries were strictly using nmm:albumArtist, but in
    reality tags often do not provide this information.
    Allow regular nmm:performer tags as fallback for the artist info.

 gnomemusic/query.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 217a976f..b8223bc8 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -338,7 +338,8 @@ class Query():
     SELECT DISTINCT
         rdf:type(?album)
         tracker:id(?album) AS ?id
-        nmm:artistName(?album_artist) AS ?artist
+        tracker:coalesce(nmm:artistName(?album_artist),
+                         nmm:artistName(?song_artist)) AS ?artist
         nie:title(?album) AS ?album
     WHERE {
         ?album a nmm:MusicAlbum .
@@ -363,7 +364,8 @@ class Query():
     SELECT DISTINCT
         rdf:type(?album)
         tracker:id(?album) AS ?id
-        nmm:artistName(?album_artist) AS ?artist
+        tracker:coalesce(nmm:artistName(?album_artist),
+                         nmm:artistName(?song_artist)) AS ?artist
         nie:title(?album) AS ?album
     WHERE {
         ?song a nmm:MusicPiece ;


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