From: epg <> Date: Sun, 26 Jun 2005 18:09:36 +0000 (+0000) Subject: Add support for reading release dates from MusicBrainz. X-Git-Url: https://diplodocus.org/git/flac-archive/commitdiff_plain/e9aa850faa0516c3ec1b54bb5b437816d192b00c Add support for reading release dates from MusicBrainz. Thanks to Matthias Friedrich for adding this to MusicBrainz::Client::Simple and suggesting it. --- diff --git a/fa-rip b/fa-rip index f327645..5066c79 100755 --- a/fa-rip +++ b/fa-rip @@ -86,6 +86,7 @@ sub tags_file { my $various = shift; my $artist = shift; my $album = shift; + my $release_dates = shift; my $fh; my $i; my $track; @@ -94,8 +95,14 @@ sub tags_file { open($fh, '>', $fn) or die("open('>$fn'): $!"); print($fh 'ARTIST=', (defined($artist) and $artist or ''), "\n"); print($fh 'ALBUM=', (defined($album) and $album or ''), "\n"); - # MusicBrainz doesn't have dates yet; these are usually wrong anyway. - print($fh "DATE=\n"); + + if (defined($release_dates) and %$release_dates) { + while (my ($country, $date) = each(%$release_dates)) { + print($fh "DATE[$country]=$date\n"); + } + } else { + print($fh "DATE=\n"); + } for $i (1 .. $trackcount) { $various and print($fh "ARTIST[$i]=\n"); @@ -143,9 +150,10 @@ sub tags { } } + my %dates = $album->get_release_dates; tags_file("candidate-tags-$i", $trackcount, $various, $album->get_artist->get_name, $album->get_name, - $album->get_tracks); + \%dates, $album->get_tracks); } }