Use year tag instead of releasedate

This commit is contained in:
Anna Rose 2010-03-25 14:58:39 -04:00 committed by Patrick Wiggins
parent 88a95d6bd7
commit e2f76a22f6

View File

@ -52,7 +52,7 @@ $album = formatName($album, 'album=', $captagnames);
# Get the release date, just use the first track
my $releasedate = 'releasedate=';
my $year;
# Parse the file list, set vorbiscomments
@ -73,8 +73,8 @@ foreach (@ARGV)
system("metaflac --remove-tag=tracknumber $_");
if (!$tracknumonly)
{
system("metaflac --remove-tag=TITLE --remove-tag=ARTIST --remove-tag=ALBUM --remove-tag=RELEASEDATE $_");
system("metaflac --remove-tag=title --remove-tag=artist --remove-tag=album --remove-tag=releasedate $_");
system("metaflac --remove-tag=TITLE --remove-tag=ARTIST --remove-tag=ALBUM --remove-tag=YEAR $_");
system("metaflac --remove-tag=title --remove-tag=artist --remove-tag=album --remove-tag=year $_");
}
}
# Preserve existing comments, except the ones we'll replace
@ -83,7 +83,7 @@ foreach (@ARGV)
foreach (`vorbiscomment -l $_`)
{
if ($tracknumonly) { print COMMENTFILE $_ unless (/^tracknumber/i); }
else { print COMMENTFILE $_ unless (/^(title)|(artist)|(tracknumber)|(album)|(releasedate)/i); }
else { print COMMENTFILE $_ unless (/^(title)|(artist)|(tracknumber)|(album)|(year)/i); }
}
}
@ -121,7 +121,7 @@ foreach (@ARGV)
# Finally, try to find the release date, if we haven't yet
if ($releasedate =~ /^releasedate=\s*$/)
if (!$year)
{
my $mbinfo = Music::Tag->new($_);
@ -130,12 +130,12 @@ foreach (@ARGV)
$mbinfo->add_plugin("MusicBrainz");
$mbinfo->get_tag();
$releasedate = formatName($mbinfo->releasedate, 'releasedate=', $captagnames);
$year = formatName($mbinfo->year, 'year=', $captagnames);
}
}
if ($tracknumonly || $releasedate =~ /^releasedate=\s*$/) { exit; }
if ($tracknumonly || $year =~ /^year=\s*$/) { exit; }
# Loop back through the files again, adding the release date
@ -150,11 +150,11 @@ foreach(@ARGV)
{
foreach (`vorbiscomment -l $_`)
{
print COMMENTFILE $_ unless (/^releasedate/i);
print COMMENTFILE $_ unless (/^year/i);
}
}
print COMMENTFILE $releasedate;
print COMMENTFILE $year;
close COMMENTFILE;
if ($isflac) { system("metaflac --import-tags-from=$COMMENTFILENAME $_"); }