From 92a94f4e77a45abc9096502bb0af69139d10a103 Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Fri, 13 Jul 2018 18:29:01 +0200 Subject: [PATCH] simplify an if and fix string formatting --- mediagoblin/media_types/video/processing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index 012ba352..79d356cc 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -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}')) -- 2.25.1