Changeset 10 in flacrip
- Timestamp:
- 02/26/14 14:37:32 (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MusicBrainz.pm
r9 r10 76 76 # select the proper medium (important for multidisc releases) 77 77 my ($medium) = $xpath->findnodes("medium-list/medium[disc-list/disc/\@id='$discid']", $release); 78 79 # disc position info 80 $info{DISCNUMBER} = $xpath->findvalue('position', $medium)->value; 81 $info{DISCTOTAL} = $xpath->findvalue('../@count', $medium)->value; 78 82 79 83 #my $ua = LWP::UserAgent->new; -
trunk/flactrack
r5 r10 8 8 9 9 use Getopt::Long qw{:config no_ignore_case}; 10 use File::Spec::Functions qw{catfile };10 use File::Spec::Functions qw{catfile splitpath}; 11 11 use File::Path; 12 12 use Audio::FLAC::Header; … … 39 39 #TODO: calculate TOC and DISCID from cuesheet if there is no MBZ_DISCID tag present 40 40 41 #TODO: also get the year from MBZ42 41 $info = get_musicbrainz_info($discid); 42 43 # if we have metadata, change the directory name to ARTIST.DATE.ALBUM, so it will sort nicely 44 my $base_dir = (splitpath($DIRECTORY))[1]; 45 my $album_dir = join('.', map { to_filename($_) } @{$info}{qw{ALBUMARTISTSORT ORIGINALDATE ALBUM}}); 46 # need to append "disc#" if this is a multidisc album 47 if ($info->{DISCTOTAL} > 1) { 48 $album_dir .= '.disc_' . $info->{DISCNUMBER}; 49 } 50 $DIRECTORY = catfile($base_dir, $album_dir); 51 #die $DIRECTORY; 43 52 } 44 53 … … 112 121 #TODO: deal with non-ascii characters (unidecode) e.g. ü --> ue 113 122 return map { 123 s/&/ and /g; 114 124 s/[^a-z0-9-_ ]+//gi; 115 125 s/ +/_/g;
Note: See TracChangeset
for help on using the changeset viewer.