@@ -115,9 +115,7 @@ def run(self, ffmpeg_bin, monitor: callable = None, **options):
115
115
"""
116
116
@TODO: add documentation
117
117
"""
118
- async_run = options .pop ('async_run' , True )
119
-
120
- if async_run :
118
+ if async_run := options .pop ('async_run' , True ):
121
119
asyncio .run (self .async_run (ffmpeg_bin , monitor , ** options ))
122
120
else :
123
121
self ._run (ffmpeg_bin , monitor , ** options )
@@ -150,7 +148,12 @@ def add_filter(self, *_filter: str):
150
148
@TODO: add documentation
151
149
"""
152
150
_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
+
154
157
self .options .update ({'filter_complex' : _filters })
155
158
156
159
def watermarking (self , path , _filter = 'overlay=10:10' ):
@@ -215,7 +218,12 @@ def flags(self, *flags: str):
215
218
@TODO: add documentation
216
219
"""
217
220
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
+
219
227
self .options .update ({'hls_flags' : hls_flags })
220
228
221
229
def finish_up (self ):
@@ -244,7 +252,7 @@ def __init__(self, _inputs):
244
252
self .inputs = _inputs
245
253
246
254
first_input = dict (copy .copy (_inputs .inputs [0 ]))
247
- self .input = first_input .get ('i' , None )
255
+ self .input = first_input .get ('i' )
248
256
self .input_temp = first_input .get ('is_tmp' , False )
249
257
250
258
def hls (self , _format : Format , ** hls_options ):
0 commit comments