Changeset 48 in flacrip


Ignore:
Timestamp:
07/18/16 15:29:42 (6 years ago)
Author:
peter
Message:

Default the --directory to the current directory.

Then, if the --all flag is set, add the ARTIST.DATE.ALBUM directory to the
end of the base directory given by --directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/flactrack

    r47 r48  
    1616use MusicBrainz; 
    1717use Text::Unidecode; 
     18use Cwd; 
    1819 
    1920# default to using tags 
     
    3637$TYPE ||= 'mp3'; 
    3738 
    38 # default the directory to be named like the flac file 
    39 ($DIRECTORY ||= $FLAC_FILE) =~ s/\.flac$//; 
     39# default to the current directory 
     40$DIRECTORY ||= cwd; 
    4041 
    4142my $flac = Audio::FLAC::Header->new($FLAC_FILE) or die "Can't read FLAC header from $FLAC_FILE\n"; 
     
    5960    } 
    6061    exit unless $info; 
     62} 
    6163 
    62     # if we have metadata, change the directory name to ARTIST.DATE.ALBUM, so it will sort nicely 
    63     my $base_dir = (splitpath($DIRECTORY))[1]; 
     64if ($ALL) { 
     65    # if we are converting an entire album file, create a directory to hold the mp3s 
     66    # name the directory ARTIST.DATE.ALBUM, so it will sort nicely 
     67    my $base_dir = $DIRECTORY; 
    6468    my $album_dir = join('.', map { to_filename($_) } @{$info}{qw{ALBUMARTISTSORT ORIGINALDATE ALBUM}}); 
    6569    # need to append "disc#" if this is a multidisc album 
Note: See TracChangeset for help on using the changeset viewer.