Changeset 5 in flacrip for trunk/flactrack
- Timestamp:
- 05/06/13 15:47:48 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/flactrack
r4 r5 11 11 use File::Path; 12 12 use Audio::FLAC::Header; 13 #TODO: put the MusicBrainz lib in a more common location 14 use lib qw{/home/peter/projects/flacrip}; 13 15 use MusicBrainz; 14 16 … … 43 45 if ($ALL) { 44 46 die "Use of --all requires a --directory\n" unless $DIRECTORY; 47 die "No track info found on MusicBrainz for $FLAC_FILE\n" unless $info; 45 48 use YAML; 46 49 my $cuesheet = $flac->cuesheet; … … 51 54 $_ => catfile($DIRECTORY, sprintf('%02d.%s', $_, to_filename($info->{TRACKS}[$_]{TITLE}))) 52 55 } (1 .. $count); 53 print Dump(\%TRACKS); 56 #print Dump(\%TRACKS); 57 for my $tracknum (sort { $a <=> $b } keys %TRACKS) { 58 printf "%2d: %s\n", $tracknum, $TRACKS{$tracknum}; 59 } 54 60 mkpath($DIRECTORY); 55 61 } 56 62 57 while (my ($tracknum, $title) = each %TRACKS) { 63 #TODO: all the option of sorting by tracknum or not 64 #while (my ($tracknum, $title) = each %TRACKS) { 65 for my $tracknum (sort { $a <=> $b } keys %TRACKS) { 58 66 if ($tracknum !~ /^\d+$/) { 59 67 warn "Don't know what to do with track number '$tracknum'"; … … 68 76 } 69 77 70 $title = quotemeta($title);78 my $title = quotemeta($TRACKS{$tracknum}); 71 79 if ($TYPE eq 'mp3') { 72 80 # bitrate of 192 … … 89 97 #die $cmd; 90 98 system $cmd; 99 die "\nFLAC decoding canceled\n" if ($? & 127); 91 100 92 101 print "\n" if $SOX_FILTER;
Note: See TracChangeset
for help on using the changeset viewer.