mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 06:22:48 +01:00
coonvert: make sure temporary are deleted if encoding is interrupted
This commit is contained in:
parent
8f9b4f0362
commit
115c0e7410
1 changed files with 6 additions and 0 deletions
|
|
@ -54,6 +54,12 @@ def encode(source, dest):
|
|||
else:
|
||||
log.error('Only converting from FLAC or MP3 implemented')
|
||||
return
|
||||
if encode.returncode != 0:
|
||||
# Something went wrong (probably Ctrl+C), remove temporary files
|
||||
log.info('Encoding {0} failed. Cleaning up...'.format(source))
|
||||
util.remove(temp_dest)
|
||||
util.prune_dirs(os.path.dirname(temp_dest))
|
||||
return
|
||||
shutil.move(temp_dest, dest)
|
||||
log.info('Finished encoding '+ source)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue