Skip to content

Commit ec10b68

Browse files
committed
Merge branch 'pr/mint-dewit/1390' into release53
2 parents ee1ee34 + 1cda4a8 commit ec10b68

File tree

61 files changed

+2518
-2362
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

+2518
-2362
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
}
392393
}
393394

@@ -413,6 +414,7 @@ export function APIStudioSettingsFrom(settings: IStudioSettings): Complete<APISt
413414
allowPieceDirectPlay: settings.allowPieceDirectPlay,
414415
enableBuckets: settings.enableBuckets,
415416
enableEvaluationForm: settings.enableEvaluationForm,
417+
mockPieceContentStatus: settings.mockPieceContentStatus,
416418
}
417419
}
418420

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

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

meteor/server/publications/pieceContentStatusUI/checkPieceContentStatus.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,27 @@ export async function checkPieceContentStatusAndDependencies(
221221
packageContainerPackageStatuses: [],
222222
}
223223

224+
if (studio.settings.mockPieceContentStatus) {
225+
return [
226+
{
227+
status: PieceStatusCode.OK,
228+
messages: [],
229+
progress: undefined,
230+
231+
freezes: [],
232+
blacks: [],
233+
scenes: [],
234+
235+
thumbnailUrl: undefined,
236+
previewUrl: '/dev/fakePreview.mp4',
237+
238+
packageName: null,
239+
contentDuration: 30 * 1000,
240+
},
241+
pieceDependencies,
242+
]
243+
}
244+
224245
const ignoreMediaStatus = piece.content && piece.content.ignoreMediaObjectStatus
225246
if (!ignoreMediaStatus) {
226247
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
@@ -17,7 +17,7 @@ import {
1717
CoreUserEditingDefinitionSofie,
1818
} from '@sofie-automation/corelib/dist/dataModel/UserEditingDefinitions'
1919
import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
20-
import { assertNever, clone, Complete, literal, omit } from '@sofie-automation/corelib/dist/lib'
20+
import { assertNever, clone, cloneObject, Complete, literal, omit } from '@sofie-automation/corelib/dist/lib'
2121
import { unprotectString, unprotectStringArray } from '@sofie-automation/corelib/dist/protectedString'
2222
import { ReadonlyDeep } from 'type-fest'
2323
import {
@@ -222,7 +222,7 @@ function convertPieceGenericToBlueprintsInner(piece: ReadonlyDeep<PieceGeneric>)
222222
expectedPackages: clone<ExpectedPackage.Any[] | undefined>(piece.expectedPackages),
223223
hasSideEffects: piece.hasSideEffects,
224224
content: {
225-
...clone(piece.content),
225+
...cloneObject(piece.content),
226226
timelineObjects: deserializePieceTimelineObjectsBlob(piece.timelineObjectsString),
227227
},
228228
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)