Skip to content

Commit

Permalink
fix: handle durations of onRundownChange infinites correctly when spa…
Browse files Browse the repository at this point in the history
…nning into another part
  • Loading branch information
Julusian committed Oct 2, 2024
1 parent e560a4c commit bb4c22b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/job-worker/src/playout/timeline/rundown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,16 @@ function generateCurrentInfinitePieceObjects(
infiniteGroup.enable.duration = infiniteInNextPart.piece.enable.duration
}

// If this piece does not continue in the next part, then set it to end with the part it belongs to
if (
const pieceInstanceWithUpdatedEndCap: PieceInstanceWithTimings = { ...pieceInstance }
// Give the infinite group and end cap when the end of the piece is known
if (pieceInstance.resolvedEndCap) {
// If the cap is a number, it is relative to the part, not the parent group so needs to be handled here
if (typeof pieceInstance.resolvedEndCap === 'number') {
infiniteGroup.enable.end = `#${timingContext.currentPartGroup.id}.start + ${pieceInstance.resolvedEndCap}`
delete pieceInstanceWithUpdatedEndCap.resolvedEndCap
}
} else if (
// If this piece does not continue in the next part, then set it to end with the part it belongs to
!infiniteInNextPart &&
currentPartInfo.partInstance.part.autoNext &&
infiniteGroup.enable.duration === undefined &&
Expand All @@ -355,7 +363,7 @@ function generateCurrentInfinitePieceObjects(
activePlaylist._id,
infiniteGroup,
nowInParent,
pieceInstance,
pieceInstanceWithUpdatedEndCap,
pieceEnable,
0,
groupClasses,
Expand Down

0 comments on commit bb4c22b

Please sign in to comment.