Changeset 5 in flacrip
Legend:
- Unmodified
- Added
- Removed
-
trunk/MusicBrainz.pm
r4 r5 53 53 # TODO: get release date 54 54 55 # select the proper medium (important for multidisc releases) 56 my ($medium) = $xpath->findnodes("medium-list/medium[disc-list/disc/\@id='$discid']", $release); 57 55 58 my $ua = LWP::UserAgent->new; 56 59 my $tracknum = 1; 57 for my $track_node ($xpath->findnodes(' .//track-list/track', $release)) {60 for my $track_node ($xpath->findnodes('track-list/track', $medium)) { 58 61 my $prefix = sprintf('TRACK%02d', $tracknum); 59 62 #$info{"$prefix.MB_TRACKID"} = $xpath->findvalue('@id', $track_node); -
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; -
trunk/mbz
r3 r5 41 41 } else { 42 42 for my $key (sort keys %{ $info }) { 43 print "$key=$$info{$key}\n" ;43 print "$key=$$info{$key}\n" unless ref $info->{$key}; 44 44 } 45 45 } -
trunk/use-cases
r1 r5 19 19 20 20 re-encode a mix as an archived flac for quick burning later 21 22 submit a CD TOC to MusicBrainz 23 => submiturl 24 => metaflac --extract-cuesheet-to - | cuesheet2tocdata
Note: See TracChangeset
for help on using the changeset viewer.