mirror of
https://github.com/moex3/flac2mp3.pl
synced 2024-11-22 03:54:15 -05:00
Add '-' as a date separator. Use arrays in arg tags too
This commit is contained in:
parent
edc18b4871
commit
6be59c9036
12
flac2mp3.pl
12
flac2mp3.pl
@ -83,11 +83,11 @@ my %idLookup = (
|
|||||||
if (length($date) == 4) { # Only year
|
if (length($date) == 4) { # Only year
|
||||||
return ["TYER", "$date"];
|
return ["TYER", "$date"];
|
||||||
}
|
}
|
||||||
if (!($date =~ m/^\d{4}\.\d{2}\.\d{2}$/)) {
|
if (!($date =~ m/^\d{4}[\.-]\d{2}[\.-]\d{2}$/)) {
|
||||||
print("Date format unknown: $date\n");
|
print("Date format unknown: $date\n");
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
$date =~ s/\./-/g;
|
$date =~ s/[\.-]/-/g;
|
||||||
return ["TDRL", "$date"]; # Release date
|
return ["TDRL", "$date"]; # Release date
|
||||||
},
|
},
|
||||||
originaldate => 'TDOR', # Also for 2.4 only
|
originaldate => 'TDOR', # Also for 2.4 only
|
||||||
@ -276,20 +276,20 @@ sub argsToTags {
|
|||||||
my $fname = shift;
|
my $fname = shift;
|
||||||
$fname =~ s!^.*/!!;
|
$fname =~ s!^.*/!!;
|
||||||
if (defined($opt_genre)) {
|
if (defined($opt_genre)) {
|
||||||
$argTags->{genre} = $opt_genre;
|
$argTags->{genre} = [$opt_genre];
|
||||||
}
|
}
|
||||||
if (defined($opt_comment) && $opt_comment ne "") {
|
if (defined($opt_comment) && $opt_comment ne "") {
|
||||||
$argTags->{comment} = $opt_comment;
|
$argTags->{comment} = [$opt_comment];
|
||||||
}
|
}
|
||||||
if (defined($opt_catid) && $opt_catid ne "") {
|
if (defined($opt_catid) && $opt_catid ne "") {
|
||||||
$argTags->{catalognumber} = $opt_catid;
|
$argTags->{catalognumber} = [$opt_catid];
|
||||||
}
|
}
|
||||||
if (scalar @opt_tagreplace > 0) {
|
if (scalar @opt_tagreplace > 0) {
|
||||||
foreach my $trepl (@opt_tagreplace) {
|
foreach my $trepl (@opt_tagreplace) {
|
||||||
$trepl =~ m!(.*?)/(.*?)=(.*)!;
|
$trepl =~ m!(.*?)/(.*?)=(.*)!;
|
||||||
my ($freg, $tag, $tagval) = ($1, $2, $3);
|
my ($freg, $tag, $tagval) = ($1, $2, $3);
|
||||||
if ($fname =~ m!$freg!) {
|
if ($fname =~ m!$freg!) {
|
||||||
$argTags->{lc($tag)} = $tagval;
|
$argTags->{lc($tag)} = ($tagval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user