]> diplodocus.org Git - flac-archive/blobdiff - fa-flacd
(flac): Whoops, need to use sanitized version in some more places.
[flac-archive] / fa-flacd
index e2a2b2189b60e6fcf28d7d5dacd36e12cd3da6d7..37e79a0a49a5ea3b01abad9c5931862786e97902 100755 (executable)
--- a/fa-flacd
+++ b/fa-flacd
@@ -85,7 +85,7 @@ sub flac {
     verbose("chdir($dir)\n");
     chdir($dir) or die("chdir($dir): $!");
 
     verbose("chdir($dir)\n");
     chdir($dir) or die("chdir($dir): $!");
 
-    $outfile = "$album.flac-tmp";
+    $outfile = "$album";
     for ($outfile) {
         s/\//_/g;
         s/:/_/g;
     for ($outfile) {
         s/\//_/g;
         s/:/_/g;
@@ -94,7 +94,7 @@ sub flac {
     }
 
     verbose("Running flac\n");
     }
 
     verbose("Running flac\n");
-    $status = system('flac', '-o', "../$artist/$outfile",
+    $status = system('flac', '-o', "../$artist/$outfile.flac-tmp",
                      '--delete-input-file', '-V', '--cuesheet',
                      'cue', '--no-padding', '--best',
                      map({ ('-T', $_) } @tags),
                      '--delete-input-file', '-V', '--cuesheet',
                      'cue', '--no-padding', '--best',
                      map({ ('-T', $_) } @tags),
@@ -110,15 +110,15 @@ sub flac {
     verbose("Cleaning up $dir\n");
     unlink('using-tags') or die("unlink(using-tags): $!");
     unlink('cue') or die("unlink(cue): $!");
     verbose("Cleaning up $dir\n");
     unlink('using-tags') or die("unlink(using-tags): $!");
     unlink('cue') or die("unlink(cue): $!");
-    rename('toc', "../$artist/$album.toc")
-      or die("rename(toc, ../$artist/$album.toc): $!");
-    rename('log', "../$artist/$album.log")
-      or die("rename(log, ../$artist/$album.log): $!");
+    rename('toc', "../$artist/$outfile.toc")
+      or die("rename(toc, ../$artist/$outfile.toc): $!");
+    rename('log', "../$artist/$outfile.log")
+      or die("rename(log, ../$artist/$outfile.log): $!");
     chdir('..') or die("chdir(..): $!");
     rmdir($dir) or die("rmdir($dir): $!");
 
     chdir('..') or die("chdir(..): $!");
     rmdir($dir) or die("rmdir($dir): $!");
 
-    rename("$artist/$album.flac-tmp", "$artist/$album.flac")
-      or die("rename($artist/$album.flac-tmp, $artist/$album.flac): $!");
+    rename("$artist/$outfile.flac-tmp", "$artist/$outfile.flac")
+      or die("rename($artist/$outfile.flac-tmp, $artist/$outfile.flac): $!");
 
     return 0;
 }
 
     return 0;
 }