fix(ai): 重叠平移挤开旧片段时补生成 update 操作

实测:新建片段插入旧时间轴间隙、把旧片段挤开时,净化层只在
模拟里移动了旧片段,没有生成对应 update 操作——模拟通过校验、
实际应用时旧片段仍在原位,applyOperations 报「视频片段重叠」。
现在挤开旧片段时自动补一条 update 操作,模拟与实装一致。
新增回归测试(旧片段被挤开必须生成 update)。
This commit is contained in:
xhgit committed 2026-11-14 18:36:41 +08:00
1 parent 2b8cc45023
commit c92a807c87
2 files changed
+11 -1

No files matched your search

+2 -1
View File
@@ -140,7 +140,8 @@ export function sanitizeOperations(p,operations){
if(vids[i].start<end-.02){
const at=Math.round(end*100)/100;
const add=addBySim.get(vids[i].id);if(add)add.clip.start=at;
else{const upd=updById.get(vids[i].id);if(upd)upd.changes.start=at;}
else{const upd=updById.get(vids[i].id);if(upd)upd.changes.start=at;
else{const entry={type:'update',id:vids[i].id,changes:{start:at}};ops.push(entry);updById.set(vids[i].id,entry);}}
vids[i].start=at;
note('视频片段重叠,已自动后移至 '+at.toFixed(1)+' 秒');
}