File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
packages/job-worker/src/playout/timeline Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -328,8 +328,16 @@ function generateCurrentInfinitePieceObjects(
328328 infiniteGroup . enable . duration = infiniteInNextPart . piece . enable . duration
329329 }
330330
331- // If this piece does not continue in the next part, then set it to end with the part it belongs to
332- if (
331+ const pieceInstanceWithUpdatedEndCap : PieceInstanceWithTimings = { ...pieceInstance }
332+ // Give the infinite group and end cap when the end of the piece is known
333+ if ( pieceInstance . resolvedEndCap ) {
334+ // If the cap is a number, it is relative to the part, not the parent group so needs to be handled here
335+ if ( typeof pieceInstance . resolvedEndCap === 'number' ) {
336+ infiniteGroup . enable . end = `#${ timingContext . currentPartGroup . id } .start + ${ pieceInstance . resolvedEndCap } `
337+ delete pieceInstanceWithUpdatedEndCap . resolvedEndCap
338+ }
339+ } else if (
340+ // If this piece does not continue in the next part, then set it to end with the part it belongs to
333341 ! infiniteInNextPart &&
334342 currentPartInfo . partInstance . part . autoNext &&
335343 infiniteGroup . enable . duration === undefined &&
@@ -355,7 +363,7 @@ function generateCurrentInfinitePieceObjects(
355363 activePlaylist . _id ,
356364 infiniteGroup ,
357365 nowInParent ,
358- pieceInstance ,
366+ pieceInstanceWithUpdatedEndCap ,
359367 pieceEnable ,
360368 0 ,
361369 groupClasses ,
You can’t perform that action at this time.
0 commit comments