verbose and tmp.append('--verbose')
lame_options = ' '.join(tmp)
- outfile = ('%s (%s) %02d %s.mp3' % (artist, album,
- track, title)).replace('/', '_')
-
# Escape any single quotes ' so we can quote this.
(fn, title, artist, album_artist,
album, date) = [(x or '').replace("'", r"'\''")
quoted_outfile = ('%s (%s) %02d %s.mp3' % (artist, outfile_album,
track, title)).replace('/', '_')
+ # HACK! :(
+ if check_missing:
+ return quoted_outfile.replace(r"'\''", "'")
- pic_options = None
+ pic_options = ''
if pics:
(fd, picfn) = tempfile.mkstemp()
f = os.fdopen(fd, 'wb')
parser.add_option('--lame-options')
parser.add_option('-q', '--quiet', action='store_true', default=False)
parser.add_option('-v', '--verbose', action='store_true', default=False)
+ parser.add_option('--check-missing-files', action='store_true',
+ default=False)
except:
traceback.print_exc()
return 2
separator = ' '
try:
global debug, flac_options, lame_options, quiet, verbose
+ global check_missing
+ check_missing = options.check_missing_files
debug = options.debug
lame_options = options.lame_options
quiet = options.quiet
artist = tags.get('ARTIST', track)
artist.extend(tags.get('FEATURING', track))
album_artist = tags.gets('ALBUMARTIST', track)
+ if check_missing:
+ mp3 = flac2mp3(fn, title,
+ ', '.join(artist),
+ album_artist, album, discnum,
+ tags.gets('DATE', track),
+ track, args[i], pics)
+ if not os.path.exists(mp3):
+ print fn
+ break
+ continue
jobs.append((fn, title,
', '.join(artist),
album_artist, album, discnum,