fix coding style errors

This commit is contained in:
Simon Kohlmeyer 2014-09-13 19:51:23 +02:00
parent 9d55179d2d
commit ee6f3dba1b
2 changed files with 5 additions and 2 deletions

View file

@ -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

View file

@ -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__)