Skip to content

Commit b554b72

Browse files
committed
fix: restore snapshot: don't update _id:s of inner objects
1 parent bf98383 commit b554b72

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/job-worker/src/playout/snapshot.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ export async function handleRestorePlaylistSnapshot(
368368
piece?: unknown
369369
}
370370
>(objs: undefined | T[], updateId: boolean): T[] {
371-
const updateIds = (obj: T) => {
371+
const updateIds = (obj: T, updateId: boolean) => {
372372
if (obj.rundownId) {
373373
obj.rundownId = getNewRundownId(obj.rundownId)
374374
}
@@ -388,15 +388,15 @@ export async function handleRestorePlaylistSnapshot(
388388
}
389389

390390
if (obj.part) {
391-
updateIds(obj.part as any)
391+
updateIds(obj.part as any, false)
392392
}
393393
if (obj.piece) {
394-
updateIds(obj.piece as any)
394+
updateIds(obj.piece as any, false)
395395
}
396396

397397
return obj
398398
}
399-
return (objs || []).map((obj) => updateIds(obj))
399+
return (objs || []).map((obj) => updateIds(obj, updateId))
400400
}
401401

402402
await Promise.all([

0 commit comments

Comments
 (0)