Derive external timeline duration from sections

This commit is contained in:
OpenClaw Agent
2026-07-20 09:17:04 +00:00
parent 8736d4a463
commit e01ceef71b
3 changed files with 13 additions and 20 deletions

View File

@@ -11589,14 +11589,10 @@ app.registerExtension({
return null;
}
const rawDuration =
self._resolveNodeLinkedValue(timelineNode, "duration", { decimals: 3 }) ??
parseFloat(self._readNodeWidgetValue(timelineNode, "duration") || 0);
const duration = Math.max(0.1, Number.isFinite(rawDuration) ? rawDuration : 5.0);
const sectionSetNode = self._findLinkedOriginNode(timelineNode, "section_set");
const setClass = sectionSetNode?.comfyClass || sectionSetNode?.type || "";
const sections = [];
let duration = 0;
if (sectionSetNode && setClass === "TimelineSectionSetCS") {
for (let i = 1; i <= 5; i++) {
const sectionNode = self._findLinkedOriginNode(sectionSetNode, `section_${i}`);
@@ -11610,6 +11606,7 @@ app.registerExtension({
self._resolveNodeLinkedValue(sectionNode, "duration", { decimals: 3 }) ??
parseFloat(self._readNodeWidgetValue(sectionNode, "duration") || 0);
const sectionDuration = Math.max(0.1, Number.isFinite(rawSectionDuration) ? rawSectionDuration : 1.0);
duration += sectionDuration;
const imageSource = self._extractLinkedImageSource(sectionNode, "image");
sections.push({
text,
@@ -11620,7 +11617,7 @@ app.registerExtension({
}
}
return { duration, sections };
return { duration: Math.max(0.1, duration), sections };
};
this._syncTimelineFromLink = function () {
const payload = self._buildExternalTimelinePayload();