stop passing format

This commit is contained in:
henryruhs
2026-04-02 22:16:01 +02:00
parent df38778558
commit 0fd6a403b8
3 changed files with 14 additions and 14 deletions
+3 -3
View File
@@ -110,13 +110,13 @@ async def save_asset_files(upload_files : List[UploadFile]) -> List[str]:
upload_task = asyncio.create_task(feed_upload_queue(upload_file, upload_queue))
if media_type == 'audio' and await asyncio.to_thread(ffmpeg.sanitize_audio, file_format, upload_queue.get, asset_path, api_security_strategy): #todo: do not pass format, do not pass queue but bytes if same speed
if media_type == 'audio' and await asyncio.to_thread(ffmpeg.sanitize_audio, upload_queue.get, asset_path, api_security_strategy):
asset_paths.append(asset_path)
if media_type == 'image' and await asyncio.to_thread(ffmpeg.sanitize_image, file_format, upload_queue.get, asset_path):
if media_type == 'image' and await asyncio.to_thread(ffmpeg.sanitize_image, upload_queue.get, asset_path):
asset_paths.append(asset_path)
if media_type == 'video' and await asyncio.to_thread(ffmpeg.sanitize_video, file_format, upload_queue.get, asset_path, api_security_strategy):
if media_type == 'video' and await asyncio.to_thread(ffmpeg.sanitize_video, upload_queue.get, asset_path, api_security_strategy):
asset_paths.append(asset_path)
await upload_task
+6 -6
View File
@@ -308,8 +308,8 @@ def concat_video(output_path : str, temp_output_paths : List[str]) -> bool:
return process.returncode == 0
def sanitize_audio(audio_format : str, media_chunk_reader : MediaChunkReader, asset_path : str, security_strategy : ApiSecurityStrategy) -> bool:
audio_pipe_format = ffmpeg_builder.resolve_audio_pipe_format(audio_format) #todo: does not make sense this methods are in the builder
def sanitize_audio(media_chunk_reader : MediaChunkReader, asset_path : str, security_strategy : ApiSecurityStrategy) -> bool:
audio_pipe_format = ffmpeg_builder.resolve_audio_pipe_format(get_file_format(asset_path)) #todo: does not make sense this methods are in the builder
if security_strategy == 'strict':
commands = ffmpeg_builder.chain(
@@ -329,8 +329,8 @@ def sanitize_audio(audio_format : str, media_chunk_reader : MediaChunkReader, as
return run_ffmpeg_with_pipe(commands, media_chunk_reader).returncode == 0
def sanitize_image(image_format : str, media_chunk_reader : MediaChunkReader, asset_path : str) -> bool:
image_pipe_format = ffmpeg_builder.resolve_image_pipe_format(image_format) #todo: does not make sense this methods are in the builder
def sanitize_image(media_chunk_reader : MediaChunkReader, asset_path : str) -> bool:
image_pipe_format = ffmpeg_builder.resolve_image_pipe_format(get_file_format(asset_path)) #todo: does not make sense this methods are in the builder
commands = ffmpeg_builder.chain(
ffmpeg_builder.pipe_image(image_pipe_format),
ffmpeg_builder.deep_copy_image(),
@@ -340,8 +340,8 @@ def sanitize_image(image_format : str, media_chunk_reader : MediaChunkReader, as
return run_ffmpeg_with_pipe(commands, media_chunk_reader).returncode == 0
def sanitize_video(video_format : str, media_chunk_reader : MediaChunkReader, asset_path : str, security_strategy : ApiSecurityStrategy) -> bool:
video_pipe_format = ffmpeg_builder.resolve_video_pipe_format(video_format) #todo: does not make sense this methods are in the builder
def sanitize_video(media_chunk_reader : MediaChunkReader, asset_path : str, security_strategy : ApiSecurityStrategy) -> bool:
video_pipe_format = ffmpeg_builder.resolve_video_pipe_format(get_file_format(asset_path)) #todo: does not make sense this methods are in the builder
if security_strategy == 'strict':
commands = ffmpeg_builder.chain(