From: Eric Gillespie Date: Thu, 7 Sep 2023 17:25:15 +0000 (-0500) Subject: add todos and fix undefined release status X-Git-Url: https://diplodocus.org/git/flac-archive/commitdiff_plain/cca5647c8aab40cfad0d1c4eeccbc75c4f6b8142 add todos and fix undefined release status --- diff --git a/fa-mb b/fa-mb index 4c6107a..f11fd93 100755 --- a/fa-mb +++ b/fa-mb @@ -53,6 +53,7 @@ sub tracks { [ map { $_ = $_->{title}; + # TODO need to apply these everywhere! also seen in ARTIST and ALBUM # unicode hacks s/‐/-/g; s/’/'/g; @@ -77,7 +78,10 @@ sub release_metadata { my $events = $_->{'release-events'}; if (defined($events)) { if (@$events > 1) { - warn('found example of multiple release events!'); + # TODO e.g. https://musicbrainz.org/release/d9bfd2d6-2bab-4fd8-9b5d-84d2a7d1457b + # Some Great Reward has two release events: 0. Europe; 1. Germany + use Data::Dumper; + warn('found example of multiple release events! ' . $_->{id} . ' ' . Dumper($events)) } my $event_date = $events->[0]->{date}; if (defined($event_date)) { @@ -117,7 +121,7 @@ sub release_metadata { date => $date, labels => join(', ', map { $_->{label}->{name} // 'UNKNOWN' } @{$_->{'label-info'} // []}), disambiguation => $_->{disambiguation} // '', - status => $_->{status}, + status => $_->{status} // '', } } @@ -135,8 +139,8 @@ sub list_releases { sprintf('%s %-10s %3d tracks / %2d discs in %s %s by %s; %s, %s', $_->{id}, $_->{date}, $_->{tracks}, $_->{discs}, - $_->{country}, $_->{title}, $_->{labels} - , $_->{disambiguation}, $_->{status}, + $_->{country}, $_->{title}, $_->{labels}, + $_->{disambiguation}, $_->{status}, ) } @$releases) }