Skip to content

Commit

Permalink
Merge pull request #1331 from darrell-k/fix-scan-multiple-mb_ids
Browse files Browse the repository at this point in the history
Fixes for Musicbrainz ID processing
  • Loading branch information
michaelherger authored Feb 19, 2025
2 parents 31f2c4e + 2b1b59c commit a75ba6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Slim/Formats.pm
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ sub readTags {
foreach my $mbID ( Slim::Music::Info::splitTag($value) ) {
if ( $tag eq 'MUSICBRAINZ_DISCID' && $mbID =~ /^[0-9a-z_\.-]{28}$/i ) {
push @mbIDs, lc($1);
} elsif ( $mbID =~ /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i ) {
} elsif ( $mbID =~ /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i ) {
push @mbIDs, lc($1);
}
else {
Expand All @@ -326,7 +326,7 @@ sub readTags {
next TAG;
}
}
$tags->{$tag} = \@mbIDs;
$value = $tags->{$tag} = \@mbIDs;
}

$tagCache{$original} = $value;
Expand Down
3 changes: 2 additions & 1 deletion Slim/Music/Info.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ sub splitTag {

# Handle Vorbis comments where the tag can be an array.
if (ref($tag) eq 'ARRAY') {

map { $_ =~ s/^\s+|\s+$//g; } @$tag;
return @$tag;
}

Expand Down Expand Up @@ -1061,6 +1061,7 @@ sub splitTag {
return @splitTags;
}

$tag =~ s/^\s+|\s+$//g;
return $tag;
}

Expand Down
2 changes: 1 addition & 1 deletion Slim/Schema.pm
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ sub _createOrUpdateAlbum {
my $disc = $attributes->{DISC};
my $discc = $attributes->{DISCC};
# Bug 10583 - Also check for MusicBrainz Album Id
my $brainzId = $attributes->{MUSICBRAINZ_ALBUM_ID};
my $brainzId = $attributes->{MUSICBRAINZ_ALBUM_ID}[0]; # Surely there is only one MB album id!
my $extId = $attributes->{EXTID} || $attributes->{ALBUM_EXTID};

# if we have a disc number from an online service, default disc count to 1
Expand Down

0 comments on commit a75ba6f

Please # to comment.