my $various = shift;
my $artist = shift;
my $album = shift;
+ my $release_dates = shift;
my $fh;
my $i;
my $track;
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");
}
}
+ 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);
}
}