Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/blueprints-integration/src/api/showStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export interface ShowStyleBlueprintManifest<
context: ISyncIngestUpdateToPartInstanceContext,
existingPartInstance: BlueprintSyncIngestPartInstance,
newData: BlueprintSyncIngestNewData,
playoutStatus: 'previous' | 'current' | 'next'
playoutStatus: 'previous' | 'current' | 'next',
playoutPersistentState: BlueprintPlayoutPersistentStore<TimelinePersistentState>
) => void

/**
Expand Down
11 changes: 10 additions & 1 deletion packages/job-worker/src/ingest/syncChangesToPartInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { PieceInstance } from '@sofie-automation/corelib/dist/dataModel/PieceIns
import { setNextPart } from '../playout/setNext.js'
import { PartId, RundownId } from '@sofie-automation/corelib/dist/dataModel/Ids'
import type { WrappedShowStyleBlueprint } from '../blueprints/cache.js'
import { PersistentPlayoutStateStore } from '../blueprints/context/services/PersistantStateStore.js'

type PlayStatus = 'previous' | 'current' | 'next'
export interface PartInstanceToSync {
Expand Down Expand Up @@ -145,13 +146,21 @@ 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)
} catch (err) {
logger.error(`Error in showStyleBlueprint.syncIngestUpdateToPartInstance: ${stringifyError(err)}`)

Expand Down
Loading