X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/74237233361b87b6b6c88e9f62e58936e60c1a3c..6b068d17c33b79554fdb3006d438c8a203812527:/flac2mp3 diff --git a/flac2mp3 b/flac2mp3 index 239739e..b2fc719 100755 --- a/flac2mp3 +++ b/flac2mp3 @@ -88,6 +88,8 @@ def flac2mp3(fn, title, artist, album_artist, album, discnum, date, verbose and tmp.append('--verbose') lame_options = ' '.join(tmp) + unquoted_fn = fn + # Escape any single quotes ' so we can quote this. (fn, title, artist, album_artist, album, date) = [(x or '').replace("'", r"'\''") @@ -112,7 +114,8 @@ def flac2mp3(fn, title, artist, album_artist, album, discnum, date, pic_options = '' (fd, picfn) = tempfile.mkstemp() os.close(fd) - p = Popen(['metaflac', '--export-picture-to=' + picfn, fn], stderr=PIPE) + p = Popen(['metaflac', '--export-picture-to', picfn, unquoted_fn], + stderr=PIPE) status = p.wait() stderr = ''.join(p.stderr) # Hacky check for flac with no album art @@ -124,8 +127,8 @@ def flac2mp3(fn, title, artist, album_artist, album, discnum, date, sys.stderr.write('metaflac exited %d: %s\n' % (status, stderr)) return pic_options = "--ti '%s'" % picfn - os.system('md5sum ' + picfn) try: + # TODO: Look at TDOR, TDRL, TDRC for date. 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 - '%s'" % (flac_options, ' '.join(skip_until), fn, lame_options, title, artist, album, date, track,