fix(worker): 修复 render_edit_plan 素材下载 + 总时长日志 + video_processing 导入链 #236
Reference in New Issue
Block a user
Delete Branch "fix/render-edit-plan-bugs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
修复内容
Bug 1: render_edit_plan 素材下载路径错误(P0)
edit_plan_generation.py中直接把clip.asset_id(数据库主键)传给download_asset,但download_asset期望的是 OSS storage_key。导致所有素材下载失败,剪辑计划渲染必然报错。修复:先批量查询 assets 表拿到 file_url(storage_key),再调用 download_asset 下载。
Bug 2: "总时长=0.0s" 日志误导(P2)
_build_plan_and_clips_from_task中构建的_VirtualClip没有赋值duration字段(默认 0.0),导致剪辑计划日志中「总时长」永远显示 0.0s,容易误判为卡死。修复:构建 clips 时用
probe_duration预探测每个素材的实际时长并赋值。Bug 3: video_processing 导入链副作用(P2)
video_processing/__init__.py顶层导入了render_adapter、unified_render_service等重依赖模块,进而引入 packages/DB 全量依赖。导致只想用oss_helpers/ffmpeg_utils等轻量工具的场景,也被迫加载全部依赖。修复:
__init__.py只导出轻量工具模块(ffmpeg_utils / oss_helpers / dedup_helpers),渲染组件按需从子模块导入。验证
c5ee72d1fdto9f9d799e7f9f9d799e7fto63b0bde41a