diff --git a/packages/blueprints-integration/src/api/showStyle.ts b/packages/blueprints-integration/src/api/showStyle.ts index 63a527b8e4c..0d290af66d4 100644 --- a/packages/blueprints-integration/src/api/showStyle.ts +++ b/packages/blueprints-integration/src/api/showStyle.ts @@ -116,7 +116,8 @@ export interface ShowStyleBlueprintManifest< context: ISyncIngestUpdateToPartInstanceContext, existingPartInstance: BlueprintSyncIngestPartInstance, newData: BlueprintSyncIngestNewData, - playoutStatus: 'previous' | 'current' | 'next' + playoutStatus: 'previous' | 'current' | 'next', + playoutPersistentState: BlueprintPlayoutPersistentStore ) => void /** diff --git a/packages/job-worker/src/ingest/syncChangesToPartInstance.ts b/packages/job-worker/src/ingest/syncChangesToPartInstance.ts index 41de01b1bfa..7f9ba5b361a 100644 --- a/packages/job-worker/src/ingest/syncChangesToPartInstance.ts +++ b/packages/job-worker/src/ingest/syncChangesToPartInstance.ts @@ -35,6 +35,7 @@ import { PieceInstance } from '@sofie-automation/corelib/dist/dataModel/PieceIns import { setNextPart } from '../playout/setNext.js' import { PartId, RundownId, SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids' import type { WrappedShowStyleBlueprint } from '../blueprints/cache.js' +import { PersistentPlayoutStateStore } from '../blueprints/context/services/PersistantStateStore.js' import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment' type PlayStatus = 'previous' | 'current' | 'next' @@ -148,14 +149,22 @@ export class SyncChangesToPartInstancesWorker { if (!this.#blueprint.blueprint.syncIngestUpdateToPartInstance) throw new Error('Blueprint does not have syncIngestUpdateToPartInstance') + const blueprintPersistentState = new PersistentPlayoutStateStore( + this.#playoutModel.playlist.privatePlayoutPersistentState, + this.#playoutModel.playlist.publicPlayoutPersistentState + ) + // The blueprint handles what in the updated part is going to be synced into the partInstance: this.#blueprint.blueprint.syncIngestUpdateToPartInstance( syncContext, existingResultPartInstance, newResultData, - instanceToSync.playStatus + instanceToSync.playStatus, + blueprintPersistentState ) + blueprintPersistentState.saveToModel(this.#playoutModel) + // Persist t-timer changes for (const timer of syncContext.changedTTimers) { this.#playoutModel.updateTTimer(timer)