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, Release group “Zoo Rave 2” by Various Artists - MusicBrainz, 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