From 432472fd19f5f58d69910f88a490bf52d1181d7e Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sat, 9 Aug 2025 10:57:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- biz/ffmpeg.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/biz/ffmpeg.py b/biz/ffmpeg.py index be23fab..220d598 100644 --- a/biz/ffmpeg.py +++ b/biz/ffmpeg.py @@ -27,10 +27,6 @@ def parse_ffmpeg_task(task_info, template_info): # 统计only_if占位符的使用次数 only_if_usage_count = {} - for part in template_info.get("video_parts", []): - only_if = part.get('only_if', '') - if only_if: - only_if_usage_count[only_if] = only_if_usage_count.get(only_if, 0) + 1 with tracer.start_as_current_span("parse_ffmpeg_task.download_all") as sub_span: with ThreadPoolExecutor(max_workers=8) as executor: param_list: list[dict] @@ -48,7 +44,8 @@ def parse_ffmpeg_task(task_info, template_info): continue only_if = part.get('only_if', '') if only_if: - required_count = only_if_usage_count.get(only_if, 1) + only_if_usage_count[only_if] = only_if_usage_count.get(only_if, 0) + 1 + required_count = only_if_usage_count.get(only_if) if not check_placeholder_exist_with_count(only_if, task_params_orig, required_count): logger.info("because only_if exist, placeholder: %s insufficient (need %d), skip part: %s", only_if, required_count, part) continue