After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768520 - AcoustID plugin: Support fetching recording artist for the "artist" key
AcoustID plugin: Support fetching recording artist for the "artist" key
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
0.3.x
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2016-07-07 13:21 UTC by Saiful B. Khan
Modified: 2016-07-12 09:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (2.14 KB, patch)
2016-07-07 13:22 UTC, Saiful B. Khan
none Details | Review
Fetch artist or recording instead of release-group (1.89 KB, patch)
2016-07-09 03:28 UTC, Saiful B. Khan
none Details | Review
Add test samples to verify the adjustments (38.42 KB, patch)
2016-07-09 17:30 UTC, Saiful B. Khan
none Details | Review
Fetch artist or recording instead of release-group (1.46 KB, patch)
2016-07-11 11:20 UTC, Saiful B. Khan
accepted-commit_now Details | Review
Add test samples to verify the artist retrieval (38.51 KB, patch)
2016-07-11 11:22 UTC, Saiful B. Khan
accepted-commit_now Details | Review

Description Saiful B. Khan 2016-07-07 13:21:09 UTC
As acoustID source is meant to be used with a single audio piece at a time, its GRL_METADATA_KEY_ARTIST should contain the song/recording artist and not the album-artist (which could be from a compilation album). Instead the GRL_METADATA_KEY_ALBUM_ARTIST key will be used for storing the album-artist.
Comment 1 Saiful B. Khan 2016-07-07 13:22:18 UTC
Created attachment 330999 [details] [review]
Patch

Allow fetching artist and album-artist both from acoustID source.
Comment 2 Victor Toso 2016-07-07 14:41:53 UTC
Review of attachment 330999 [details] [review]:

Also, I would really appreciate a new test case for this. I don't think we can test this with the 4 cases I've included in the past.

Many thanks!

::: src/lua-factory/sources/grl-acoustid.lua
@@ +32,3 @@
+    "title",
+    "album",
+    "album_artist",

should be album-artist

@@ +37,3 @@
+    "mb-album-id",
+    "mb-artist-id"
+  },

It is fine to have this table in one line for now

@@ +133,3 @@
   -- and for that reason we are only returning first of all metadata
+  if record and record.artists and #record.artists > 0 then
+    artist = record.artists[1]

Please, let's do it in two patches. The first one is this fix here...

@@ +141,3 @@
+  if album and album.artists and #album.artists > 0 then
+    album_artist = album.artists[1]
+    media.album_artist = keys.album_artist and album_artist.name or nil

and the second one is including the album_artist
Comment 3 Saiful B. Khan 2016-07-09 03:28:40 UTC
Created attachment 331118 [details] [review]
Fetch artist or recording instead of release-group

Victor,

Thanks for the review. I made the changes as you had suggested. And there should be no need for new tests for this change. The samples you had provided originally are just fine (i.e., their recording-artist and release-group artists are both same for all 4 test samples, so acoustID-test still returns 'OK').

If there's need for correction, let me know.
Comment 4 Bastien Nocera 2016-07-09 13:56:38 UTC
Can you add another test where the album artist and the artist would be different, just to make sure that the functionality is working as expected?
Comment 5 Saiful B. Khan 2016-07-09 17:30:13 UTC
Created attachment 331137 [details] [review]
Add test samples to verify the adjustments

Alright here you go. This one sample has different 'album-artist' ('Various Artists' for the first releasegroup) from the recording artist ('Radiohead' for the first recording). Sorry if the metadata file got a bit too large, I couldn't help it. The original problem itself occurs for songs that have been reused in many different compilations.

Please let me know if this addition is alright.
Comment 6 Victor Toso 2016-07-11 10:32:15 UTC
Review of attachment 331118 [details] [review]:

This patch fixes the artist metadata-key, so, you don't need to include album-artist
Besides that, patch is fine

::: src/lua-factory/sources/grl-acoustid.lua
@@ +29,3 @@
   name = "Acoustid",
   description = "a source that provides audio identification",
+  supported_keys = {"title", "album", "album-artist", "artist", "mb-recording-id", "mb-album-id", "mb-artist-id" },

For this patch, you don't need to change supported-keys.
Comment 7 Victor Toso 2016-07-11 10:39:35 UTC
Review of attachment 331137 [details] [review]:

Please, include in the commit log that this test is needed to check album-artist != artist which should be more clear with album-artist validation (could be together with album-artist support)
Comment 8 Saiful B. Khan 2016-07-11 11:20:18 UTC
Created attachment 331203 [details] [review]
Fetch artist or recording instead of release-group

Removed extra supported key
Comment 9 Saiful B. Khan 2016-07-11 11:22:34 UTC
Created attachment 331204 [details] [review]
Add test samples to verify the artist retrieval

Edited commit log to include the sample's importance.
Comment 10 Victor Toso 2016-07-12 09:10:42 UTC
Review of attachment 331203 [details] [review]:

Sure
Comment 11 Victor Toso 2016-07-12 09:11:59 UTC
Review of attachment 331204 [details] [review]:

Looks good