From 166a020bedbb923860b1c757fa8afa517ff72fc5 Mon Sep 17 00:00:00 2001 From: wwwwwwwww <526125649@qq.com> Date: Thu, 6 Aug 2026 17:07:33 +0800 Subject: [PATCH] 1 --- video-gen-api/app/services/api_v3/upscale_service.py | 3 ++- video-gen-api/app/tasks/api_generation_tasks.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/video-gen-api/app/services/api_v3/upscale_service.py b/video-gen-api/app/services/api_v3/upscale_service.py index 7fc135c3..04e65a9d 100644 --- a/video-gen-api/app/services/api_v3/upscale_service.py +++ b/video-gen-api/app/services/api_v3/upscale_service.py @@ -117,6 +117,7 @@ async def prepare_api_upscale_task( source_width: int = 0, source_height: int = 0, source_duration: float = 0.0, + source_file_size_bytes: int = 0 ) -> "VideoUpscaleTask | None": """为 API 任务创建超分子任务。 @@ -162,7 +163,7 @@ async def prepare_api_upscale_task( source_local_path=api_task.local_path or source_local_path, # 优先使用已下载的本地文件 source_remote_url=api_task.remote_result_url, # 火山 MediaKit 需要远程 URL input_source_type="provider_remote", - source_file_size_bytes=0, + source_file_size_bytes=source_file_size_bytes, source_width=source_width, source_height=source_height, source_duration_seconds=source_duration, diff --git a/video-gen-api/app/tasks/api_generation_tasks.py b/video-gen-api/app/tasks/api_generation_tasks.py index f0afc025..199fe1a8 100644 --- a/video-gen-api/app/tasks/api_generation_tasks.py +++ b/video-gen-api/app/tasks/api_generation_tasks.py @@ -527,7 +527,7 @@ async def _download_generation_result(self, task_id: str) -> dict[str, Any]: try: abs_path = os.path.abspath(dest_path) if os.path.exists(abs_path): - task.source_file_size_bytes = os.path.getsize(abs_path) + source_file_size_bytes = os.path.getsize(abs_path) # 使用 probe_video 探测实际视频尺寸和时长 from app.services.video_upscale.media_service import probe_video source_info = await probe_video(abs_path) @@ -549,6 +549,7 @@ async def _download_generation_result(self, task_id: str) -> dict[str, Any]: source_width=source_width, source_height=source_height, source_duration=source_duration, + source_file_size_bytes=source_file_size_bytes ) # 如果已存在超分任务(重复调用),检查超分状态