From 1b434a7daee9bad96b2b8a017932acd25af85534 Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Sat, 5 Apr 2014 21:07:31 +0200 Subject: [PATCH] Import original file when conversion fails. Fixes previous test --- beetsplug/convert.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beetsplug/convert.py b/beetsplug/convert.py index 031b4d839..7dd1b0aa6 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -120,6 +120,7 @@ def encode(source, dest): log.info(u'Finished encoding {0}'.format( util.displayable_path(source)) ) + return True def should_transcode(item): @@ -200,7 +201,9 @@ def convert_on_import(lib, item): fd, dest = tempfile.mkstemp(ext) os.close(fd) _temp_files.append(dest) # Delete the transcode later. - encode(item.path, dest) + if encode(item.path, dest) is None: + # FIXME we should raise an exception instead + return item.path = dest item.write() item.read() # Load new audio information data.