diff --git a/beetsplug/convert.py b/beetsplug/convert.py index e60d5fb07..a72965b43 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -130,8 +130,9 @@ def should_transcode(item, format): """Determine whether the item should be transcoded as part of conversion (i.e., its bitrate is high or it has the wrong format). """ - if config['convert']['never_convert_lossy_files'] and not (item.format.lower() in LOSSLESS_FORMATS): - return False + if config['convert']['never_convert_lossy_files'] and \ + not (item.format.lower() in LOSSLESS_FORMATS): + return False maxbr = config['convert']['max_bitrate'].get(int) return format.lower() != item.format.lower() or \ item.bitrate >= 1000 * maxbr diff --git a/test/test_convert.py b/test/test_convert.py index 4a6119884..68fd77f7e 100644 --- a/test/test_convert.py +++ b/test/test_convert.py @@ -124,6 +124,7 @@ class ConvertCliTest(unittest.TestCase, TestHelper): mediafile = MediaFile(converted) self.assertEqual(mediafile.images[0].data, image_data) + class NeverConvertLossyFilesTest(unittest.TestCase, TestHelper): def setUp(self): @@ -163,6 +164,7 @@ class NeverConvertLossyFilesTest(unittest.TestCase, TestHelper): converted = os.path.join(self.convert_dest, 'converted.mp3') self.assertTrue(os.path.isfile(converted)) + def suite(): return unittest.TestLoader().loadTestsFromName(__name__)