X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/31cfad82f74bdd8d803c214e4755bd9c82d8e4db..6ca18c015e6e66589c8aa3620c7a11efb7cc836a:/fa-flacd diff --git a/fa-flacd b/fa-flacd index e291b75..7e13bd9 100755 --- a/fa-flacd +++ b/fa-flacd @@ -1,4 +1,4 @@ -#! /usr/bin/env python2.4 +#! /usr/bin/python """ =head1 NAME @@ -109,7 +109,8 @@ def run_flac(infile, cue, outfile, tags): argv.extend(['-T', i]) argv.append(infile) # flac 1.1.3 PICTURE support - argv.extend(['--picture', '3|image/jpeg|||cover.front']) + if os.path.exists('cover.front'): + argv.extend(['--picture', '3|image/jpeg|||cover.front']) spew('Running flac\n') status = os.spawnvp(os.P_WAIT, argv[0], argv) @@ -189,7 +190,10 @@ def flac(dir, tracknum, tags): ld = os.listdir(dir) if ld == ['using-tags'] or sorted(ld) == ['cover.front', 'using-tags']: try: - os.unlink(dir + '/cover.front') + try: + os.unlink(dir + '/cover.front') + except OSError: + pass os.unlink(dir + '/using-tags') os.rmdir(dir) except EnvironmentError: