]> diplodocus.org Git - flac-archive/blobdiff - fa-flacd
(flac2mp3): Oops, keep an unmunged version of the output filename,
[flac-archive] / fa-flacd
index 59b09c4ca47fba18a26155d06b8485f7e2d4e5bc..bef49542aef9d1aa945bf58f2af94ed5d087b1f4 100755 (executable)
--- a/fa-flacd
+++ b/fa-flacd
@@ -106,6 +106,8 @@ def run_flac(infile, cue, outfile, tags):
     for i in tags:
         argv.extend(['-T', i])
     argv.append(infile)
+    # flac 1.1.3 PICTURE support
+    #argv.extend(['--picture', '3|image/jpeg|||cover.front'])
 
     spew('Running flac\n')
     status = os.spawnvp(os.P_WAIT, argv[0], argv)
@@ -142,7 +144,7 @@ def flac(dir, artist, album, discnum, tracknum, track_tags, disc_artist, tags):
     if tracknum == None:
         outfile = album
         if discnum != None:
-            outfile = ''.join([outfile, ' (disc ', discnum, ')'])
+            outfile = ''.join([discnum, ' ', outfile])
         run_flac('wav', 'cue', '/'.join(['..', artist, outfile]), tags)
         files = ['%s/%s.flac' % (artist, outfile)]
 
@@ -190,8 +192,10 @@ def flac(dir, artist, album, discnum, tracknum, track_tags, disc_artist, tags):
     # Clean up if we're the last job for dir; for multi-file dirs,
     # it's possible for more than one job to run cleanup at once, so
     # don't fail if things are already clean.
-    if os.listdir(dir) == ['using-tags']:
+    ld = os.listdir(dir)
+    if ld == ['using-tags'] or sorted(ld) == ['cover.front', 'using-tags']:
         try:
+            os.unlink(dir + '/cover.front')
             os.unlink(dir + '/using-tags')
             os.rmdir(dir)
         except EnvironmentError: