X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/d8fad45f88f2afc36f7daca6de06e60a9b975a9f..8690768dfd3ceece4f3d5f505d1716f645e030fc:/flac2mp3 diff --git a/flac2mp3 b/flac2mp3 index 28aee35..1884f61 100755 --- a/flac2mp3 +++ b/flac2mp3 @@ -104,19 +104,20 @@ def flac2mp3(fn, title, artist, album_artist, album, date, quoted_outfile = ('%s (%s) %02d %s.mp3' % (artist, album, track, title)).replace('/', '_') - picfn = None + pic_options = None if pics: (fd, picfn) = tempfile.mkstemp() f = os.fdopen(fd, 'wb') f.write(pics[0][7]) f.close() + pic_options = "--ti '%s'" % picfn try: - run_or_die(3, "flac %s -cd %s '%s' | lame --id3v2-only --id3v2-latin1 --pad-id3v2-size 0 %s --tt '%s' --ta '%s' --tl '%s' --ty '%s' --tn %d --ti '%s' %s - '%s'" + run_or_die(3, "flac %s -cd %s '%s' | lame --id3v2-only --id3v2-latin1 --pad-id3v2-size 0 %s --tt '%s' --ta '%s' --tl '%s' --ty '%s' --tn %d %s %s - '%s'" % (flac_options, ' '.join(skip_until), fn, lame_options, title, artist, album, date, track, - picfn, album_artist_options, quoted_outfile)) + pic_options, album_artist_options, quoted_outfile)) finally: - if picfn: + if pic_options: try: os.unlink(picfn) except: