Skip to content

Commit c01f9b8

Browse files
committed
wip: sync ingest changes
fix: multigateway mode wip: adlib clear layer wip wip: absolute piece extensions wip: timeline building wip: create and propogate pieceinstances wip: theoretical ingest flow
1 parent c267d55 commit c01f9b8

File tree

58 files changed

+916
-246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+916
-246
lines changed

meteor/__mocks__/helpers/database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ export async function setupMockShowStyleBlueprint(
468468
rundown,
469469
globalAdLibPieces: [],
470470
globalActions: [],
471+
globalPieces: [],
471472
baseline: { timelineObjects: [] },
472473
}
473474
},

meteor/server/api/ingest/packageInfo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export async function onUpdatedPackageInfo(packageId: ExpectedPackageId, _doc: P
3535
case ExpectedPackageDBType.ADLIB_ACTION:
3636
case ExpectedPackageDBType.BASELINE_ADLIB_PIECE:
3737
case ExpectedPackageDBType.BASELINE_ADLIB_ACTION:
38+
case ExpectedPackageDBType.BASELINE_PIECE:
3839
case ExpectedPackageDBType.RUNDOWN_BASELINE_OBJECTS:
3940
onUpdatedPackageInfoForRundownDebounce(pkg)
4041
break

meteor/server/migration/1_50_0.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ export const addSteps = addMigrationSteps('1.50.0', [
917917

918918
const partIdLookup = new Map<PieceId | AdLibActionId | RundownBaselineAdLibActionId, PartId>()
919919
for (const piece of pieces) {
920-
partIdLookup.set(piece._id, piece.startPartId)
920+
if (piece.startPartId) partIdLookup.set(piece._id, piece.startPartId)
921921
}
922922
for (const adlib of adlibPieces) {
923923
if (adlib.partId) partIdLookup.set(adlib._id, adlib.partId)

meteor/server/publications/pieceContentStatusUI/rundown/regenerateItems.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export async function regenerateForPieceIds(
107107
{
108108
_id: protectString(`piece_${pieceId}`),
109109

110-
partId: pieceDoc.startPartId,
110+
partId: pieceDoc.startPartId ?? undefined,
111111
rundownId: pieceDoc.startRundownId,
112112
pieceId: pieceId,
113113

@@ -180,7 +180,7 @@ export async function regenerateForPieceInstanceIds(
180180
const res: UIPieceContentStatus = {
181181
_id: protectString(`piece_${pieceId}`),
182182

183-
partId: pieceDoc.piece.startPartId,
183+
partId: pieceDoc.piece.startPartId ?? undefined,
184184
rundownId: pieceDoc.rundownId,
185185
pieceId: pieceId,
186186

packages/blueprints-integration/src/api/showStyle.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import type {
3535
IBlueprintSegment,
3636
IBlueprintPiece,
3737
IBlueprintPart,
38+
IBlueprintRundownPiece,
39+
IBlueprintRundownPieceDB,
3840
} from '../documents'
3941
import type { IBlueprintShowStyleVariant, IOutputLayer, ISourceLayer } from '../showStyle'
4042
import type { TSR, OnGenerateTimelineObj, TimelineObjectCoreExt } from '../timeline'
@@ -260,6 +262,7 @@ export interface BlueprintResultRundown {
260262
rundown: IBlueprintRundown
261263
globalAdLibPieces: IBlueprintAdLibPiece[]
262264
globalActions: IBlueprintActionManifest[]
265+
globalPieces: IBlueprintRundownPiece[]
263266
baseline: BlueprintResultBaseline
264267
}
265268
export interface BlueprintResultSegment {
@@ -286,6 +289,11 @@ export interface BlueprintSyncIngestNewData {
286289
actions: IBlueprintActionManifest[]
287290
/** A list of adlibs that have pieceInstances in the partInstance in question */
288291
referencedAdlibs: IBlueprintAdLibPieceDB[]
292+
/**
293+
* The list of pieces which belong to the Rundown, and may be active
294+
* Note: Some of these may have played and been stopped before the current PartInstance
295+
*/
296+
rundownPieces: IBlueprintRundownPieceDB[]
289297
}
290298

291299
// TODO: add something like this later?

packages/blueprints-integration/src/documents/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ export * from './pieceInstance'
77
export * from './pieceGeneric'
88
export * from './playlistTiming'
99
export * from './rundown'
10+
export * from './rundownPiece'
1011
export * from './rundownPlaylist'
1112
export * from './segment'

packages/blueprints-integration/src/documents/pieceInstance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { IBlueprintPieceDB } from './piece'
44
export interface IBlueprintPieceInstance<TPrivateData = unknown, TPublicData = unknown> {
55
_id: string
66
/** The part instace this piece belongs to */
7-
partInstanceId: string
7+
partInstanceId: string | null
88

99
/** If this piece has been created play-time using an AdLibPiece, this should be set to it's source piece */
1010
adLibSourceId?: string
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { IBlueprintPieceGeneric } from './pieceGeneric'
2+
3+
/**
4+
* A variant of a Piece, that is owned by the Rundown.
5+
* This
6+
*/
7+
export interface IBlueprintRundownPiece<TPrivateData = unknown, TPublicData = unknown>
8+
extends Omit<IBlueprintPieceGeneric<TPrivateData, TPublicData>, 'lifespan'> {
9+
/** When the piece should be active on the timeline. */
10+
enable: {
11+
start: number
12+
duration?: number
13+
14+
// For now, these pieces are always absolute (using wall time) rather than relative to the rundown
15+
isAbsolute: true
16+
}
17+
18+
// /** Whether and how the piece is infinite */
19+
// lifespan: PieceLifespan
20+
21+
/** Whether the piece is a real piece, or exists as a marker to stop an infinite piece. If virtual, it does not add any contents to the timeline */
22+
virtual?: boolean
23+
24+
/** Whether the piece affects the output of the Studio or is describing an invisible state within the Studio */
25+
notInVision?: boolean
26+
}
27+
28+
/** The Rundown piece sent from Core */
29+
export interface IBlueprintRundownPieceDB<TPrivateData = unknown, TPublicData = unknown>
30+
extends IBlueprintRundownPiece<TPrivateData, TPublicData> {
31+
_id: string
32+
}

packages/corelib/src/dataModel/ExpectedPackages.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export type ExpectedPackageFromRundownBaseline =
3232
| ExpectedPackageDBFromBaselineAdLibAction
3333
| ExpectedPackageDBFromBaselineAdLibPiece
3434
| ExpectedPackageDBFromRundownBaselineObjects
35+
| ExpectedPackageDBFromBaselinePiece
3536

3637
export type ExpectedPackageDBFromBucket = ExpectedPackageDBFromBucketAdLib | ExpectedPackageDBFromBucketAdLibAction
3738

@@ -47,6 +48,7 @@ export enum ExpectedPackageDBType {
4748
ADLIB_ACTION = 'adlib_action',
4849
BASELINE_ADLIB_PIECE = 'baseline_adlib_piece',
4950
BASELINE_ADLIB_ACTION = 'baseline_adlib_action',
51+
BASELINE_PIECE = 'baseline_piece',
5052
BUCKET_ADLIB = 'bucket_adlib',
5153
BUCKET_ADLIB_ACTION = 'bucket_adlib_action',
5254
RUNDOWN_BASELINE_OBJECTS = 'rundown_baseline_objects',
@@ -79,6 +81,13 @@ export interface ExpectedPackageDBFromPiece extends ExpectedPackageDBBase {
7981
/** The rundown of the Piece this package belongs to */
8082
rundownId: RundownId
8183
}
84+
export interface ExpectedPackageDBFromBaselinePiece extends ExpectedPackageDBBase {
85+
fromPieceType: ExpectedPackageDBType.BASELINE_PIECE
86+
/** The Piece this package belongs to */
87+
pieceId: PieceId
88+
/** The rundown of the Piece this package belongs to */
89+
rundownId: RundownId
90+
}
8291

8392
export interface ExpectedPackageDBFromBaselineAdLibPiece extends ExpectedPackageDBBase {
8493
fromPieceType: ExpectedPackageDBType.BASELINE_ADLIB_PIECE

packages/corelib/src/dataModel/Piece.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ export interface PieceGeneric extends Omit<IBlueprintPieceGeneric, 'content'> {
5353
export interface Piece
5454
extends PieceGeneric,
5555
Omit<IBlueprintPieceDB, '_id' | 'content' | 'userEditOperations' | 'userEditProperties'> {
56+
/** Timeline enabler. When the piece should be active on the timeline. */
57+
enable: {
58+
start: number | 'now' // TODO - now will be removed from this eventually, but as it is not an acceptable value 99% of the time, that is not really breaking
59+
duration?: number
60+
61+
// Pieces owned by the Rundown should always be absolute
62+
isAbsolute?: boolean
63+
}
64+
5665
/**
5766
* This is the id of the rundown this piece starts playing in.
5867
* Currently this is the only rundown the piece could be playing in
@@ -62,12 +71,12 @@ export interface Piece
6271
* This is the id of the segment this piece starts playing in.
6372
* It is the only segment the piece could be playing in, unless the piece has a lifespan which spans beyond the segment
6473
*/
65-
startSegmentId: SegmentId
74+
startSegmentId: SegmentId | null
6675
/**
6776
* This is the id of the part this piece starts playing in.
6877
* If the lifespan is WithinPart, it is the only part the piece could be playing in.
6978
*/
70-
startPartId: PartId
79+
startPartId: PartId | null
7180

7281
/** Whether this piece is a special piece */
7382
pieceType: IBlueprintPieceType

0 commit comments

Comments
 (0)