X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/19b87656f5d6ee53f075ba5f70b726650e0e3421..bb9f6b14aedf4a0730abc94b2d368a5d7eae0f70:/fa-rip 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); } }