# ARTIST[5]=Reba McEntire
# ARTIST[5]=Vince Gill
+# TODO
+# - sub filename in (fa-encode, fa-mp3cd, and flac2mp3) TESTED
+# - use PART, PARTNUMBER, VERSION in those filenames
+# - replace tags.pl with fa-tags which the others still import but which is a tool
+# - perltidy
+# - -bt=2 Strictest brace tightness
+# - -pt=2 Strictest paren tightness
+# - -nvc No vertical code alignment
+# - -se errors to stderr... how is this not the default?
+
use v5.12;
use warnings;
warn("looks like DESCRIPTION had multiple lines; discarding and returning early: $_");
last
}
- die("no field name in: $_");
+ # TODO oops i left 'TITLE[]=(pregap)' in every file for R.E.M. - Monster!
+ warn("no field name in: $_");
+ next
}
$name = $1;
# TODO validate $name
$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) {
}
}
- $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
- 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
discnumber => $discnumber,
tracknumber => $tracknumber,
title => $title,
+ version => $version,
)
}
$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...
$fn
}