Don't put VERSION or PARTNUMBER into filenames on CD.
Those need to stay short!
(map { two_digits($_) } @{$tags->{DISCNUMBER} // []}),
(map { two_digits($_) } @{$tags->{TRACKNUMBER} // []}),
@{$tags->{TITLE}},
(map { two_digits($_) } @{$tags->{DISCNUMBER} // []}),
(map { two_digits($_) } @{$tags->{TRACKNUMBER} // []}),
@{$tags->{TITLE}},
- @{$tags->{VERSION} // []},
- @{$tags->{PARTNUMBER} // []},
use FindBin;
use lib $FindBin::Bin;
use FindBin;
use lib $FindBin::Bin;
my $flac = shift;
my $tags = shift;
my $flac = shift;
my $tags = shift;
+ my @version;
+ if (defined($tags->{version})) {
+ @version = ('(' . $tags->{version} . ')');
+ }
+
# This is an old TODO; what's wrong with --ty ?
# TODO: Look at TDOR, TDRL, TDRC for date.
say(
# This is an old TODO; what's wrong with --ty ?
# TODO: Look at TDOR, TDRL, TDRC for date.
say(
'--tn',
quote($tags->{tracknumber}),
'--tt',
'--tn',
quote($tags->{tracknumber}),
'--tt',
+ quote(join(' ', $tags->{title}, @version)),
'--ty',
quote($tags->{date}),
'$pic_options',
'--ty',
quote($tags->{date}),
'$pic_options',
$date = $tags{DATE}->[0];
}
$date = $tags{DATE}->[0];
}
+ my $version;
+ if (defined($tags{VERSION})) {
+ if (@{$tags{VERSION}} != 1) {
+ die('one or zero VERSION tags required')
+ }
+ $version = $tags{VERSION}->[0];
+ }
+
my @discnumber = ();
if (defined($tags{DISCNUMBER})) {
if (@{$tags{DISCNUMBER}} != 1) {
my @discnumber = ();
if (defined($tags{DISCNUMBER})) {
if (@{$tags{DISCNUMBER}} != 1) {
- $artist, $album_tag, $date, \@discnumber
+ $artist, $album_tag, $date, \@discnumber, $version
}
# TODO dedup with flac2mp3
sub track_tags {
my $tags = shift;
# TODO probably ought to return hash too. then track_tags would augment
}
# TODO dedup with flac2mp3
sub track_tags {
my $tags = shift;
# TODO probably ought to return hash too. then track_tags would augment
- my ($artist, $album, $date, $discnumber) = disc_tags(%$tags);
+ my ($artist, $album, $date, $discnumber, $version) = disc_tags(%$tags);
# TODO resurrect whole-disc FLAC?
# Stupid hack: only a single-track file should have the
# TODO resurrect whole-disc FLAC?
# Stupid hack: only a single-track file should have the
discnumber => $discnumber,
tracknumber => $tracknumber,
title => $title,
discnumber => $discnumber,
tracknumber => $tracknumber,
title => $title,
$fn =~ s/-[_-]/_/g; # more
$fn =~ s/^[_-]+//; # discard any _ or - at beginning
$fn =~ s/[_-]+$//; # at end too
$fn =~ s/-[_-]/_/g; # more
$fn =~ s/^[_-]+//; # discard any _ or - at beginning
$fn =~ s/[_-]+$//; # at end too
+ $fn =~ s/_[_-]/_/g; # XXX repeated collapse?! test and fix...