Abcde not working correctly with multiple releases and various artists

musicbrainz
api
Tags: #<Tag:0x00007f23c6bc6b00> #<Tag:0x00007f23c6bc6498>

#1

I am seeing some bad behavior for abcde when I am working with a disc with multiple artists and multiple releases. I am using abcde version 2.7.2-1, which in turn calls abcde-musicbrainz-tool. The problem I am seeing is that the first release in the list has the correct artists on all the tracks, but the tracks on other releases have an empty artist field. For example, this release group, http://musicbrainz.org/release-group/94252f1d-0138-3393-9012-c96b72301904, returns (with my extra error handling below):

Multiple Musicbrainz matches:
#1: ---- Various Artists / Zoo Rave 2 ----
1: DJ JD / The Djinni
2: Voyager / Vibetribations
3: Texas Audio / Earthbase 1
4: 2nd Injection / Obsolete
5: Age of Kali / Naughty, Naughty, Naughty
6: AAR / The Raggadelic Anthem in E Flat Minor (feat. Dread Flimstone)
7: Texas Audio / Mystery Cafe
8: Bleu / Inner Sanctum (feat. Copper)
9: 10-AC / Voodoo Fire
10: Psychedelic Evolution / I Think I Want Some More

#2: ---- Various Artists / Zoo Rave 2 ----
1: MISSING ARTIST / The Djinni
2: MISSING ARTIST / Vibetribations
3: MISSING ARTIST / Earthbase 1
4: MISSING ARTIST / Obsolete
5: MISSING ARTIST / Naughty, Naughty, Naughty
6: MISSING ARTIST / The Raggadelic Anthem in E Flat Minor (feat. Dread Flimstone)
7: MISSING ARTIST / Mystery Cafe
etc.

In the real code (without my added error handling for the missing artist), the second match throws an unhandled error and you get blank lines.

I want to know whether this is an issue with abcde or an issue with the musicbrainz api. I think it is the latter because as I understand the rules, a release can have the order of tracks re-arranged (or bonus tracks added, etc) and still be considered part of the same release group. If so, for the api to provide the correct information in those cases, it has to return an artist on every track on every release, not just the tracks of the first release.

The code in abcde-musicbrainz-tool looks something like this (showing only the relevent parts) (there are a couple of comments prefixed with jrv: where I made some code changes to point out the problem):

my $ws = WebService::MusicBrainz::Release->new();
my $response = $ws->search({ DISCID => $discid });
my @releases = $response->release_list();
foreach my $release (@releases) {
    my $va = 0;
    if ($a_artist =~ /Various Artists/) {
        $va = 1;
    }

    my @tracks = @{$release->track_list()->tracks()};
    for (my $i = 0; $i < scalar(@tracks); $i++) {
        my $track = $tracks[$i];
        my $t_name = $track->title;
        if ($va) {
            my $t_artist;
            # jrv: this is error handling I added
            # jrv: only the first release in the list has the correct artist. Tracks on other releases have empty
            # jrv: artist fields. Without this error handling, the line is blank because $track->artist->name throws
            # jrv: an exception
            if ( $track->artist ) {
                $t_artist = $track->artist->name;
            } else {
                $t_artist = "MISSING ARTIST";
            }
            printf OUT "TTITLE%d=%s / %s\n", $i, $t_artist, $t_name;
        } else {
            printf OUT "TTITLE%d=%s\n", $i, $t_name;
        }
    }
}

JR


#2

You’d want to check the XML being received by WebService::MusicBrainz::Release to see where the problem is. Before it parses the XML, you should just be able to insert a print STDERR $xml or similar to dump it out.


#3

For those interested, the way to print the raw xml is:

my $ws = WebService::musicbrainz::Release->new();
my $response = $ws->search({ DISCID => $discid });
print STDERR $response->as_xml();

The first release has artists:

<track-list>
  <track id="e7097679-946f-433b-87ce-16745260ca04">
    <title>The Djinni</title>
    <duration>282200</duration>
    <artist id="ba08e074-e813-46b7-afc0-e9135adee444">
      <name>DJ JD</name>
      <sort-name>DJ JD</sort-name>
    </artist>
  </track>
  ... etc.

The second and following do not:

<track-list>
  <track id="e7097679-946f-433b-87ce-16745260ca04">
    <title>The Djinni</title>
    <duration>282200</duration>
  </track>
  ... etc.

This could still be an abcde error if somehow the request is not sending the correct parameters, e.g. the default is to send back only the first artists on the first release, and abcde needs to include a setting that says, “send artists for all releases,” or something similar. That seems unlikely, but I am hoping that someone with some knowledge of the api can confirm or deny that this is a musicbrainz api problem. It looks like one to me.

JR


#4

The main issue here is that abcde is using the old version 1 of the web service, which is deprecated for years and has some issues caused by the underlying database structure having changed too much.

I can confirm the service version 1 has the issue, see this query:

http://musicbrainz.org/ws/1/release?discid=bfpR1_IguRzV1SbnhoCxyQUkgkM-&inc=tracks

Same results with version 2:

http://musicbrainz.org/ws/2/discid/bfpR1_IguRzV1SbnhoCxyQUkgkM-?inc=artist-credits%2Brecordings

Bu the solution to this really should be for abcdef to update to the new version finally. This will also avoid other issues, such as ws1 not dealing with multi-disc releases well.


#5

Thanks; that was very helpful.

As best I can tell, the details are more convoluted. abcde uses the webservice-musicbrainz perl module ( https://github.com/bfaist/webservice-musicbrainz). That perl module uses the v1 api. In order to upgrade abcde, the webservice-musicbrainz perl module would have to be upgraded to the v2 api or a new perl module created (an attempt was made at https://github.com/mavit/webservice-musicbrainz, but it didn’t get very far I think) then abcde would need to be upgraded to use the new webservice-musicbrainz perl module, assuming the change in api would cause breaking changes to the perl module.

JR


#6

I have submitted a bug with the maintainer of the perl module: https://github.com/bfaist/webservice-musicbrainz/issues/4.

JR


#7

I’ve started creating a minimal v2 perl API as part of my .cue ISRC importer… https://gitlab.com/derobert/CueISRC has what I’ve done so far (not ready for use by anyone yet, though).


#8

FWIW, ws/1 is also likely to be EOL’d when we switch to API key access for the ws/2 (which will probably happen later this year or in 2017, so not too far off).


#9

Is there any documentation about the plans (for the API key)? Would like to make sure it’s easy enough for me to add when it happens.


#10

Not really. I think all there is currently, is “hidden” in the chat logs