Skip to content

Commit 462f20f

Browse files
committed
Merge branch 'release51' into release52
2 parents 8a10914 + 4253eea commit 462f20f

File tree

9 files changed

+93
-48
lines changed

9 files changed

+93
-48
lines changed

meteor/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [1.51.5](///compare/v1.51.4...v1.51.5) (2025-01-07)
6+
7+
8+
### Bug Fixes
9+
10+
* **job-worker/playout:** Hold mode doesn't work at all a7d6999
11+
512
### [1.51.4](///compare/v1.51.3...v1.51.4) (2024-12-04)
613

714

packages/blueprints-integration/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.51.5](https://github.com/nrkno/sofie-core/compare/v1.51.4...v1.51.5) (2025-01-07)
7+
8+
**Note:** Version bump only for package @sofie-automation/blueprints-integration
9+
10+
11+
12+
13+
614
## [1.51.4](https://github.com/nrkno/sofie-core/compare/v1.51.3...v1.51.4) (2024-12-04)
715

816
**Note:** Version bump only for package @sofie-automation/blueprints-integration

packages/job-worker/src/playout/model/PlayoutModel.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,15 @@ export interface PlayoutModel extends PlayoutModelReadonly, StudioPlayoutModelBa
248248
cycleSelectedPartInstances(): void
249249

250250
/**
251-
* Update loop markers anytime something sinificant occurs that could result in entering or exiting the mode.
251+
* Update loop markers anytime something significant occurs that could result in entering or exiting the mode.
252252
*/
253253
updateQuickLoopState(): void
254254

255+
/*
256+
* Reset the hold state to a base state
257+
*/
258+
resetHoldState(): void
259+
255260
/**
256261
* Set the RundownPlaylist as deactivated
257262
*/

packages/job-worker/src/playout/model/implementation/PlayoutModelImpl.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,13 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
493493
this.playlistImpl.nextPartInfo = null
494494
this.playlistImpl.lastTakeTime = getCurrentTime()
495495

496-
if (!this.playlistImpl.holdState || this.playlistImpl.holdState === RundownHoldState.COMPLETE) {
497-
this.playlistImpl.holdState = RundownHoldState.NONE
498-
} else {
499-
this.playlistImpl.holdState = this.playlistImpl.holdState + 1
500-
}
501-
502496
this.#playlistHasChanged = true
503497
}
504498

499+
resetHoldState(): void {
500+
this.setHoldState(RundownHoldState.NONE)
501+
}
502+
505503
deactivatePlaylist(): void {
506504
delete this.playlistImpl.activationId
507505

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

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,23 @@ export async function performTakeToNextedPart(
174174
}
175175
}
176176

177+
// If hold is COMPLETE, clear the hold state by this take
177178
if (playoutModel.playlist.holdState === RundownHoldState.COMPLETE) {
178179
playoutModel.setHoldState(RundownHoldState.NONE)
179180

180-
// If hold is active, then this take is to clear it
181+
// If hold is ACTIVE, then this take is to complete it
181182
} else if (playoutModel.playlist.holdState === RundownHoldState.ACTIVE) {
182183
await completeHold(context, playoutModel, await pShowStyle, currentPartInstance)
183184

185+
await updateTimeline(context, playoutModel)
186+
184187
if (span) span.end()
185188

186189
return
187190
}
188191

189192
const takePartInstance = nextPartInstance
190-
if (!takePartInstance) throw new Error('takePart not found!')
193+
if (!takePartInstance) throw new Error('takePartInstance not found!')
191194
const takeRundown = playoutModel.getRundown(takePartInstance.partInstance.rundownId)
192195
if (!takeRundown)
193196
throw new Error(`takeRundown: takeRundown not found! ("${takePartInstance.partInstance.rundownId}")`)
@@ -264,12 +267,10 @@ export async function performTakeToNextedPart(
264267
// Once everything is synced, we can choose the next part
265268
await setNextPart(context, playoutModel, nextPart, false)
266269

267-
// Setup the parts for the HOLD we are starting
268-
if (
269-
playoutModel.playlist.previousPartInfo &&
270-
(playoutModel.playlist.holdState as RundownHoldState) === RundownHoldState.ACTIVE
271-
) {
272-
startHold(context, currentPartInstance, nextPartInstance)
270+
// If the Hold is PENDING, make it active
271+
if (playoutModel.playlist.holdState === RundownHoldState.PENDING) {
272+
// Setup the parts for the HOLD we are starting
273+
activateHold(context, playoutModel, currentPartInstance, takePartInstance)
273274
}
274275
await afterTake(context, playoutModel, takePartInstance)
275276

@@ -555,35 +556,39 @@ export async function afterTake(
555556
/**
556557
* A Hold starts by extending the "extendOnHold"-able pieces in the previous Part.
557558
*/
558-
function startHold(
559+
function activateHold(
559560
context: JobContext,
561+
playoutModel: PlayoutModel,
560562
holdFromPartInstance: PlayoutPartInstanceModel | null,
561563
holdToPartInstance: PlayoutPartInstanceModel | undefined
562564
) {
563565
if (!holdFromPartInstance) throw new Error('previousPart not found!')
564566
if (!holdToPartInstance) throw new Error('currentPart not found!')
565-
const span = context.startSpan('startHold')
567+
const span = context.startSpan('activateHold')
568+
569+
playoutModel.setHoldState(RundownHoldState.ACTIVE)
566570

567571
// Make a copy of any item which is flagged as an 'infinite' extension
568572
const pieceInstancesToCopy = holdFromPartInstance.pieceInstances.filter((p) => !!p.pieceInstance.piece.extendOnHold)
569-
pieceInstancesToCopy.forEach((instance) => {
570-
if (!instance.pieceInstance.infinite) {
571-
// mark current one as infinite
572-
instance.prepareForHold()
573-
574-
// This gets deleted once the nextpart is activated, so it doesnt linger for long
575-
const extendedPieceInstance = holdToPartInstance.insertHoldPieceInstance(instance)
576-
577-
const content = clone(instance.pieceInstance.piece.content) as VTContent | undefined
578-
if (content?.fileName && content.sourceDuration && instance.pieceInstance.plannedStartedPlayback) {
579-
content.seek = Math.min(
580-
content.sourceDuration,
581-
getCurrentTime() - instance.pieceInstance.plannedStartedPlayback
582-
)
583-
}
584-
extendedPieceInstance.updatePieceProps({ content })
573+
for (const instance of pieceInstancesToCopy) {
574+
// skip any infinites
575+
if (instance.pieceInstance.infinite) continue
576+
577+
instance.prepareForHold()
578+
579+
// This gets deleted once the nextpart is activated, so it doesnt linger for long
580+
const extendedPieceInstance = holdToPartInstance.insertHoldPieceInstance(instance)
581+
582+
const content = clone(instance.pieceInstance.piece.content) as VTContent | undefined
583+
if (content?.fileName && content.sourceDuration && instance.pieceInstance.plannedStartedPlayback) {
584+
content.seek = Math.min(
585+
content.sourceDuration,
586+
getCurrentTime() - instance.pieceInstance.plannedStartedPlayback
587+
)
585588
}
586-
})
589+
extendedPieceInstance.updatePieceProps({ content })
590+
}
591+
587592
if (span) span.end()
588593
}
589594

@@ -595,19 +600,16 @@ async function completeHold(
595600
): Promise<void> {
596601
playoutModel.setHoldState(RundownHoldState.COMPLETE)
597602

598-
if (playoutModel.playlist.currentPartInfo) {
599-
if (!currentPartInstance) throw new Error('currentPart not found!')
600-
601-
// Clear the current extension line
602-
innerStopPieces(
603-
context,
604-
playoutModel,
605-
showStyleCompound.sourceLayers,
606-
currentPartInstance,
607-
(p) => !!p.infinite?.fromHold,
608-
undefined
609-
)
610-
}
603+
if (!playoutModel.playlist.currentPartInfo) return
604+
if (!currentPartInstance) throw new Error('currentPart not found!')
611605

612-
await updateTimeline(context, playoutModel)
606+
// Clear the current extension line
607+
innerStopPieces(
608+
context,
609+
playoutModel,
610+
showStyleCompound.sourceLayers,
611+
currentPartInstance,
612+
(p) => !!p.infinite?.fromHold,
613+
undefined
614+
)
613615
}

packages/job-worker/src/playout/timings/partPlayback.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export async function onPartPlaybackStarted(
5858
// this is the next part, clearly an autoNext has taken place
5959

6060
playoutModel.cycleSelectedPartInstances()
61+
playoutModel.resetHoldState()
6162

6263
reportPartInstanceHasStarted(context, playoutModel, playingPartInstance, data.startedPlayback)
6364

packages/mos-gateway/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.51.5](https://github.com/nrkno/sofie-core/compare/v1.51.4...v1.51.5) (2025-01-07)
7+
8+
**Note:** Version bump only for package mos-gateway
9+
10+
11+
12+
13+
614
## [1.51.4](https://github.com/nrkno/sofie-core/compare/v1.51.3...v1.51.4) (2024-12-04)
715

816
**Note:** Version bump only for package mos-gateway

packages/playout-gateway/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.51.5](https://github.com/nrkno/sofie-core/compare/v1.51.4...v1.51.5) (2025-01-07)
7+
8+
**Note:** Version bump only for package playout-gateway
9+
10+
11+
12+
13+
614
## [1.51.4](https://github.com/nrkno/sofie-core/compare/v1.51.3...v1.51.4) (2024-12-04)
715

816
**Note:** Version bump only for package playout-gateway

packages/server-core-integration/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.51.5](https://github.com/nrkno/sofie-core/compare/v1.51.4...v1.51.5) (2025-01-07)
7+
8+
**Note:** Version bump only for package @sofie-automation/server-core-integration
9+
10+
11+
12+
13+
614
## [1.51.4](https://github.com/nrkno/sofie-core/compare/v1.51.3...v1.51.4) (2024-12-04)
715

816
**Note:** Version bump only for package @sofie-automation/server-core-integration

0 commit comments

Comments
 (0)