Skip to content

Commit 92ee08d

Browse files
authored
Merge pull request Sofie-Automation#1410 from nrkno/fix/rebase/r52/syncingestchanges-removePartInstance
fix: reimplement `removePartInstance` flow for `syncChangesToPartInstances`
2 parents 7080d60 + 17106c7 commit 92ee08d

File tree

4 files changed

+785
-199
lines changed

4 files changed

+785
-199
lines changed

packages/blueprints-integration/src/context/syncIngestChangesContext.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import type {
55
IBlueprintPiece,
66
IBlueprintPieceInstance,
77
} from '../documents'
8+
import type { IEventContext } from './eventContext'
89

9-
export interface ISyncIngestUpdateToPartInstanceContext extends IRundownUserContext {
10+
export interface ISyncIngestUpdateToPartInstanceContext extends IRundownUserContext, IEventContext {
1011
/** Sync a pieceInstance. Inserts the pieceInstance if new, updates if existing. Optionally pass in a mutated Piece, to override the content of the instance */
1112
syncPieceInstance(
1213
pieceInstanceId: string,

packages/job-worker/src/blueprints/context/SyncIngestUpdateToPartInstanceContext.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
serializePieceTimelineObjectsBlob,
3232
} from '@sofie-automation/corelib/dist/dataModel/Piece'
3333
import { EXPECTED_INGEST_TO_PLAYOUT_TIME } from '@sofie-automation/shared-lib/dist/core/constants'
34+
import { getCurrentTime } from '../../lib'
3435

3536
export class SyncIngestUpdateToPartInstanceContext
3637
extends RundownUserContext
@@ -40,6 +41,10 @@ export class SyncIngestUpdateToPartInstanceContext
4041

4142
private partInstance: PlayoutPartInstanceModel | null
4243

44+
public get hasRemovedPartInstance(): boolean {
45+
return !this.partInstance
46+
}
47+
4348
constructor(
4449
private readonly _context: JobContext,
4550
contextInfo: ContextInfo,
@@ -209,4 +214,8 @@ export class SyncIngestUpdateToPartInstanceContext
209214

210215
return unprotectStringArray(pieceInstanceIdsToRemove)
211216
}
217+
218+
getCurrentTime(): number {
219+
return getCurrentTime()
220+
}
212221
}

0 commit comments

Comments
 (0)