simplify an if and fix string formatting
authorBoris Bobrov <breton@cynicmansion.ru>
Fri, 13 Jul 2018 16:29:01 +0000 (18:29 +0200)
committerBoris Bobrov <breton@cynicmansion.ru>
Fri, 13 Jul 2018 16:29:01 +0000 (18:29 +0200)
mediagoblin/media_types/video/processing.py

index 012ba35277c537eeef1da073421493b9a71bd84c..79d356cc41507e5a025f0349e6db6ddcddc6ec3f 100644 (file)
@@ -260,11 +260,10 @@ class CommonVideoProcessor(MediaProcessor):
         # If we didn't transcode, then we need to keep the original
         self.did_transcode = False
         for each_res in self.video_config['available_resolutions']:
-            if ('webm_' + str(each_res)) in self.entry.media_files:
+            if 'webm_{}'.format(each_res) in self.entry.media_files:
                 self.did_transcode = True
                 break
-        if not self.did_transcode or \
-           (self.video_config['keep_original'] and self.did_transcode):
+        if not self.did_transcode or self.video_config['keep_original']:
             copy_original(
                 self.entry, self.process_filename,
                 self.name_builder.fill('{basename}{ext}'))