@@ -115,9 +115,7 @@ def run(self, ffmpeg_bin, monitor: callable = None, **options):
115115 """
116116 @TODO: add documentation
117117 """
118- async_run = options .pop ('async_run' , True )
119-
120- if async_run :
118+ if async_run := options .pop ('async_run' , True ):
121119 asyncio .run (self .async_run (ffmpeg_bin , monitor , ** options ))
122120 else :
123121 self ._run (ffmpeg_bin , monitor , ** options )
@@ -150,7 +148,12 @@ def add_filter(self, *_filter: str):
150148 @TODO: add documentation
151149 """
152150 _filters = self .options .pop ('filter_complex' , None )
153- _filters = _filters + "," + "," .join (list (_filter )) if _filters is not None else "," .join (list (_filter ))
151+ _filters = (
152+ f'{ _filters } ,' + "," .join (list (_filter ))
153+ if _filters is not None
154+ else "," .join (list (_filter ))
155+ )
156+
154157 self .options .update ({'filter_complex' : _filters })
155158
156159 def watermarking (self , path , _filter = 'overlay=10:10' ):
@@ -215,7 +218,12 @@ def flags(self, *flags: str):
215218 @TODO: add documentation
216219 """
217220 hls_flags = self .options .pop ('hls_flags' , None )
218- hls_flags = hls_flags + "+" + "+" .join (list (flags )) if hls_flags is not None else "+" .join (list (flags ))
221+ hls_flags = (
222+ f'{ hls_flags } +' + "+" .join (list (flags ))
223+ if hls_flags is not None
224+ else "+" .join (list (flags ))
225+ )
226+
219227 self .options .update ({'hls_flags' : hls_flags })
220228
221229 def finish_up (self ):
@@ -244,7 +252,7 @@ def __init__(self, _inputs):
244252 self .inputs = _inputs
245253
246254 first_input = dict (copy .copy (_inputs .inputs [0 ]))
247- self .input = first_input .get ('i' , None )
255+ self .input = first_input .get ('i' )
248256 self .input_temp = first_input .get ('is_tmp' , False )
249257
250258 def hls (self , _format : Format , ** hls_options ):
0 commit comments