Skip to content

Commit bedc819

Browse files
committed
Merge branch 'upstream/release53' into bbc-release53
2 parents f279a2d + aa2a5e0 commit bedc819

File tree

61 files changed

+2590
-2365
lines changed

Some content is hidden

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

61 files changed

+2590
-2365
lines changed

meteor/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ COPY meteor /opt/core/meteor
3030
COPY scripts /opt/core/scripts
3131
WORKDIR /opt/core/meteor
3232

33+
# remove the dev only assets from the webui output
34+
RUN rm -Rf /opt/core/packages/webui/dist/dev
3335
# move the webui to the correct place
3436
RUN rm -Rf /opt/core/meteor/public
3537
RUN cp -R /opt/core/packages/webui/dist /opt/core/meteor/public

meteor/server/api/rest/v1/typeConversion.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ export function studioSettingsFrom(apiStudioSettings: APIStudioSettings): Comple
388388
allowPieceDirectPlay: apiStudioSettings.allowPieceDirectPlay ?? true, // Backwards compatible
389389
enableBuckets: apiStudioSettings.enableBuckets ?? true, // Backwards compatible
390390
enableEvaluationForm: apiStudioSettings.enableEvaluationForm ?? true, // Backwards compatible
391+
mockPieceContentStatus: apiStudioSettings.mockPieceContentStatus,
391392
rundownGlobalPiecesPrepareTime: apiStudioSettings.rundownGlobalPiecesPrepareTime,
392393
}
393394
}
@@ -414,6 +415,7 @@ export function APIStudioSettingsFrom(settings: IStudioSettings): Complete<APISt
414415
allowPieceDirectPlay: settings.allowPieceDirectPlay,
415416
enableBuckets: settings.enableBuckets,
416417
enableEvaluationForm: settings.enableEvaluationForm,
418+
mockPieceContentStatus: settings.mockPieceContentStatus,
417419
rundownGlobalPiecesPrepareTime: settings.rundownGlobalPiecesPrepareTime,
418420
}
419421
}

meteor/server/lib/rest/v1/studios.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,6 @@ export interface APIStudioSettings {
222222
allowPieceDirectPlay?: boolean
223223
enableBuckets?: boolean
224224
enableEvaluationForm?: boolean
225+
mockPieceContentStatus?: boolean
225226
rundownGlobalPiecesPrepareTime?: number
226227
}

meteor/server/publications/pieceContentStatusUI/checkPieceContentStatus.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,27 @@ export async function checkPieceContentStatusAndDependencies(
225225
packageContainerPackageStatuses: [],
226226
}
227227

228+
if (studio.settings.mockPieceContentStatus) {
229+
return [
230+
{
231+
status: PieceStatusCode.OK,
232+
messages: [],
233+
progress: undefined,
234+
235+
freezes: [],
236+
blacks: [],
237+
scenes: [],
238+
239+
thumbnailUrl: undefined,
240+
previewUrl: '/dev/fakePreview.mp4',
241+
242+
packageName: null,
243+
contentDuration: 30 * 1000,
244+
},
245+
pieceDependencies,
246+
]
247+
}
248+
228249
const ignoreMediaStatus = piece.content && piece.content.ignoreMediaObjectStatus
229250
if (!ignoreMediaStatus) {
230251
if (piece.expectedPackages) {

packages/blueprints-integration/src/content.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { JSONBlob } from '@sofie-automation/shared-lib/dist/lib/JSONBlob'
22
import { Time } from './common'
33
import { TSR, TimelineObjectCoreExt } from './timeline'
44
import { SourceLayerType } from '@sofie-automation/shared-lib/dist/core/model/ShowStyle'
5+
import { PopupPreview } from './previews'
56

67
export type WithTimeline<T extends BaseContent> = T & {
78
timelineObjects: TimelineObjectCoreExt<TSR.TSRTimelineContent>[]
@@ -19,6 +20,11 @@ export interface BaseContent {
1920
ignoreBlackFrames?: boolean
2021
ignoreFreezeFrame?: boolean
2122
ignoreAudioFormat?: boolean
23+
24+
/**
25+
* Overwrite any default hover previews in Sofie
26+
*/
27+
popUpPreview?: PopupPreview
2228
}
2329

2430
// eslint-disable-next-line @typescript-eslint/no-empty-interface

packages/blueprints-integration/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export * from './util'
2121
export * from './translations'
2222
export * from './triggers'
2323
export * from './userEditing'
24+
export * from './previews'
2425

2526
export { MOS } from '@sofie-automation/shared-lib/dist/mos'
2627

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import { SplitsContentBoxContent, SplitsContentBoxProperties } from './content'
2+
import { NoteSeverity } from './lib'
3+
import { ITranslatableMessage } from './translations'
4+
5+
export interface PopupPreview<P extends Previews = Previews> {
6+
name?: string
7+
preview?: P
8+
warnings?: InvalidPreview[]
9+
}
10+
export type Previews = TablePreview | ScriptPreview | HTMLPreview | SplitPreview | VTPreview | BlueprintImagePreview
11+
12+
export enum PreviewType {
13+
Invalid = 'invalid',
14+
Table = 'table',
15+
Script = 'script',
16+
HTML = 'html',
17+
Split = 'split',
18+
VT = 'vt',
19+
BlueprintImage = 'blueprintImage',
20+
}
21+
22+
interface PreviewBase {
23+
type: PreviewType
24+
}
25+
26+
export interface InvalidPreview extends PreviewBase {
27+
type: PreviewType.Invalid
28+
29+
severity: NoteSeverity
30+
reason: ITranslatableMessage
31+
}
32+
export interface TablePreview extends PreviewBase {
33+
type: PreviewType.Table
34+
35+
entries: { key: string; value: string }[]
36+
displayTiming: boolean
37+
}
38+
export interface ScriptPreview extends PreviewBase {
39+
type: PreviewType.Script
40+
41+
fullText?: string
42+
lastWords?: string
43+
comment?: string
44+
lastModified?: number
45+
}
46+
export interface HTMLPreview extends PreviewBase {
47+
// todo - expose if and how steps can be controlled
48+
type: PreviewType.HTML
49+
50+
name?: string
51+
52+
previewUrl: string
53+
previewDimension?: { width: number; height: number }
54+
55+
postMessageOnLoad?: any
56+
57+
steps?: { current: number; total: number }
58+
}
59+
export interface SplitPreview extends PreviewBase {
60+
type: PreviewType.Split
61+
62+
background?: string // file asset upload?
63+
boxes: (SplitsContentBoxContent & SplitsContentBoxProperties)[]
64+
}
65+
export interface VTPreview extends PreviewBase {
66+
type: PreviewType.VT
67+
68+
// note: the info required for the preview follows from package manager so there's nothing for blueprins here
69+
// note: if we want to allow a preview for different media than saved on the piece (because perhaps the media is in a non-primary piece) should we allow to specifiy the package to preview?
70+
71+
inWords?: string // note - only displayed if outWords are present
72+
outWords?: string
73+
}
74+
export interface BlueprintImagePreview extends PreviewBase {
75+
type: PreviewType.BlueprintImage
76+
77+
image: string // to be put in as asset
78+
}

packages/corelib/src/lib.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { iterateDeeply, iterateDeeplyEnum, Time } from '@sofie-automation/bluepr
88
import { IStudioSettings } from './dataModel/Studio'
99
import { customAlphabet as createNanoid } from 'nanoid'
1010
import type { ITranslatableMessage } from './TranslatableMessage'
11+
import { ReadonlyObjectDeep } from 'type-fest/source/readonly-deep'
1112

1213
/**
1314
* Limited character set to use for id generation
@@ -63,6 +64,10 @@ export function clone<T>(o: ReadonlyDeep<T> | Readonly<T> | T): T {
6364
// Use this instead of fast-clone directly, as this retains the type
6465
return fastClone(o as any)
6566
}
67+
export function cloneObject<T extends object>(o: ReadonlyObjectDeep<T> | Readonly<T> | T): T {
68+
// Use this instead of fast-clone directly, as this retains the type
69+
return fastClone(o as any)
70+
}
6671

6772
/**
6873
* Deeply freeze an object

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
CoreUserEditingDefinitionSofie,
2222
} from '@sofie-automation/corelib/dist/dataModel/UserEditingDefinitions'
2323
import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
24-
import { assertNever, clone, Complete, literal, omit } from '@sofie-automation/corelib/dist/lib'
24+
import { assertNever, clone, cloneObject, Complete, literal, omit } from '@sofie-automation/corelib/dist/lib'
2525
import { unprotectString, unprotectStringArray } from '@sofie-automation/corelib/dist/protectedString'
2626
import { ReadonlyDeep } from 'type-fest'
2727
import {
@@ -231,7 +231,7 @@ function convertPieceGenericToBlueprintsInner(piece: ReadonlyDeep<PieceGeneric>)
231231
expectedPackages: clone<ExpectedPackage.Any[] | undefined>(piece.expectedPackages),
232232
hasSideEffects: piece.hasSideEffects,
233233
content: {
234-
...clone(piece.content),
234+
...cloneObject(piece.content),
235235
timelineObjects: deserializePieceTimelineObjectsBlob(piece.timelineObjectsString),
236236
},
237237
abSessions: clone<PieceAbSessionInfo[] | undefined>(piece.abSessions),

packages/job-worker/src/ingest/expectedMediaItems.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function generateExpectedMediaItems<T extends ExpectedMediaItemBase>(
4444
commonProps: Subtract<T, ExpectedMediaItemBase>,
4545
studioId: StudioId,
4646
label: string,
47-
content: Partial<SomeContent> | undefined,
47+
content: Partial<SomeContent | ReadonlyDeep<SomeContent>> | undefined,
4848
pieceType: string
4949
): T[] {
5050
const result: T[] = []

0 commit comments

Comments
 (0)