fix: from-assets 创建片段后调用 mark_clips_ready 转为 ready 状态 #1517
Reference in New Issue
Block a user
Delete Branch "fix/mark-clips-ready-after-from-assets"
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?
问题
用户点击"确认生成"后报错"渲染失败: 没有可渲染的就绪片段"。
根因:
/clips/from-assets接口创建片段后状态为pending,但从未调用mark_clips_ready()将其转为ready,渲染管线找不到就绪片段。修复
在
create_clips_from_assets_editor函数的return之前,调用plan_svc.mark_clips_ready(plan_id)。mark_clips_ready已存在于edit_plan_service.py,逻辑:遍历 plan 下所有 pending 且 asset_id 非空的片段,调用mark_ready()转为 ready。变更文件
apps/api/app/api/routes/templates_editor/clips.py— 新增plan_svc.mark_clips_ready(plan_id)调用tests/unit/test_editor_clips_random_start.py— 新增TestMarkClipsReadyAfterCreation测试类,验证 mark_clips_ready 被正确调用验证
mark_clips_ready.assert_called_once_with(plan_id)🚀 预览环境已部署
【阻塞级判定】
📊 审查概览
🔴 阻塞级问题(必须修复)
无
💡 改进建议(不阻塞合并)
无
✅ 良好实践
TestMarkClipsReadyAfterCreation准确验证了mark_clips_ready方法的调用时机和参数,确保了代码修改的有效性,防止回归。clips.py中添加了清晰的注释,说明了修改的业务背景(确保渲染管线能找到就绪片段),提高了代码的可维护性。🤖 由 AI 代码审查机器人自动生成 | 2026-08-27 02:24:00 | 模型:
CI全绿,自动审批通过。
CI全绿,自动审批通过。
🗑️ 预览环境已清理
PR #1517 已关闭或合并,对应的预览环境已被清理。