[gnome-music/wip/mschraal/tageditor-13feb2020: 9/25] grltrackerwrapper: Retrieve musicbrainz artist id for songs
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/tageditor-13feb2020: 9/25] grltrackerwrapper: Retrieve musicbrainz artist id for songs
- Date: Thu, 13 Feb 2020 22:13:55 +0000 (UTC)
commit b3da57892d7919e34890c09b2613af79ee9d17bb
Author: Jean Felder <jfelder src gnome org>
Date: Fri Jan 24 02:38:39 2020 +0100
grltrackerwrapper: Retrieve musicbrainz artist id for songs
gnomemusic/grilowrappers/grltrackerwrapper.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
---
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index b3d99a6a..3f5df737 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -49,6 +49,7 @@ class GrlTrackerWrapper(GObject.GObject):
Grl.METADATA_KEY_DURATION,
Grl.METADATA_KEY_FAVOURITE,
Grl.METADATA_KEY_ID,
+ Grl.METADATA_KEY_MB_ARTIST_ID,
Grl.METADATA_KEY_MB_RECORDING_ID,
Grl.METADATA_KEY_MB_TRACK_ID,
Grl.METADATA_KEY_PLAY_COUNT,
@@ -308,6 +309,7 @@ class GrlTrackerWrapper(GObject.GObject):
nie:url(?song) AS ?url
nie:title(?song) AS ?title
nmm:artistName(nmm:performer(?song)) AS ?artist
+ tracker:referenceIdentifier(?artist_id) AS ?mb_artist_id
nie:title(nmm:musicAlbum(?song)) AS ?album
?album_artist AS ?album_artist
nfo:duration(?song) AS ?duration
@@ -333,6 +335,12 @@ class GrlTrackerWrapper(GObject.GObject):
?song nmm:musicAlbum ?album .
?album nmm:albumArtist/nmm:artistName ?album_artist .
}
+ OPTIONAL {
+ ?song nmm:performer ?artist .
+ ?artist tracker:hasExternalReference ?artist_id .
+ ?artist_id tracker:referenceSource
+ "https://musicbrainz.org/doc/Artist" .
+ }
OPTIONAL {
?song nao:hasTag ?tag .
FILTER (?tag = nao:predefined-tag-favorite)
@@ -407,6 +415,7 @@ class GrlTrackerWrapper(GObject.GObject):
nie:url(?song) AS ?url
nie:title(?song) AS ?title
nmm:artistName(nmm:performer(?song)) AS ?artist
+ tracker:referenceIdentifier(?artist_id) AS ?mb_artist_id
nie:title(nmm:musicAlbum(?song)) AS ?album
?album_artist AS ?album_artist
nfo:duration(?song) AS ?duration
@@ -432,6 +441,12 @@ class GrlTrackerWrapper(GObject.GObject):
?song nmm:musicAlbum ?album .
?album nmm:albumArtist/nmm:artistName ?album_artist .
}
+ OPTIONAL {
+ ?song nmm:performer ?artist .
+ ?artist tracker:hasExternalReference ?artist_id .
+ ?artist_id tracker:referenceSource
+ "https://musicbrainz.org/doc/Artist" .
+ }
OPTIONAL {
?song nao:hasTag ?tag .
FILTER (?tag = nao:predefined-tag-favorite)
@@ -677,6 +692,7 @@ class GrlTrackerWrapper(GObject.GObject):
nie:url(?song) AS ?url
nie:title(?song) AS ?title
nmm:artistName(nmm:performer(?song)) AS ?artist
+ tracker:referenceIdentifier(?artist_id) AS ?mb_artist_id
nie:title(nmm:musicAlbum(?song)) AS ?album
?album_artist AS ?album_artist
nfo:duration(?song) AS ?duration
@@ -700,6 +716,12 @@ class GrlTrackerWrapper(GObject.GObject):
"https://musicbrainz.org/doc/Track" .
}
OPTIONAL { ?album nmm:albumArtist/nmm:artistName ?album_artist . }
+ OPTIONAL {
+ ?song nmm:performer ?artist .
+ ?artist tracker:hasExternalReference ?artist_id .
+ ?artist_id tracker:referenceSource
+ "https://musicbrainz.org/doc/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]