Index: /trunk/flactrack
===================================================================
--- /trunk/flactrack	(revision 47)
+++ /trunk/flactrack	(revision 48)
@@ -16,4 +16,5 @@
 use MusicBrainz;
 use Text::Unidecode;
+use Cwd;
 
 # default to using tags
@@ -36,6 +37,6 @@
 $TYPE ||= 'mp3';
 
-# default the directory to be named like the flac file
-($DIRECTORY ||= $FLAC_FILE) =~ s/\.flac$//;
+# default to the current directory
+$DIRECTORY ||= cwd;
 
 my $flac = Audio::FLAC::Header->new($FLAC_FILE) or die "Can't read FLAC header from $FLAC_FILE\n";
@@ -59,7 +60,10 @@
     }
     exit unless $info;
+}
 
-    # if we have metadata, change the directory name to ARTIST.DATE.ALBUM, so it will sort nicely
-    my $base_dir = (splitpath($DIRECTORY))[1];
+if ($ALL) {
+    # if we are converting an entire album file, create a directory to hold the mp3s
+    # name the directory ARTIST.DATE.ALBUM, so it will sort nicely
+    my $base_dir = $DIRECTORY;
     my $album_dir = join('.', map { to_filename($_) } @{$info}{qw{ALBUMARTISTSORT ORIGINALDATE ALBUM}});
     # need to append "disc#" if this is a multidisc album
