Skip to content

Commit 503e622

Browse files
committed
Merge branch 'release52' into feat/vite-ui-bundler2
2 parents 3774dcf + 497bd3d commit 503e622

File tree

89 files changed

+2671
-1402
lines changed

Some content is hidden

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

89 files changed

+2671
-1402
lines changed

.github/workflows/sonar.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
name: SonarCloud
1414
runs-on: ubuntu-latest
1515
if: ${{ github.repository_owner == 'nrkno' && !github.event.pull_request.head.repo.fork }}
16+
timeout-minutes: 15
1617

1718
steps:
1819
- uses: actions/checkout@v4

.github/workflows/trivy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
strategy:
1212
matrix:
1313
image: ["server-core", "playout-gateway", "mos-gateway"]
14+
timeout-minutes: 15
15+
1416
steps:
1517
- name: Run Trivy vulnerability scanner (json)
1618
uses: aquasecurity/trivy-action@0.24.0

DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Follow these instructions to start up Sofie Core in development mode. (For produ
1919
### Prerequisites
2020

2121
- Install [Node.js](https://nodejs.org) 14 (using [nvm](https://github.com/nvm-sh/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows) is the recommended way to install Node.js)
22-
- Install [Meteor](https://www.meteor.com/install) (`npm install --global meteor`)
22+
- Install [Meteor](https://www.meteor.com/install) (`npm install --global meteor@2`)
2323
- Install [Node.js](https://nodejs.org) 18 (using the same method you used above, you can uninstall node 14 if needed)
2424
- Install an older version of corepack (`npm install --global corepack@0.15.3`)
2525
- Enable [corepack](https://nodejs.org/api/corepack.html#corepack) (`corepack enable`) as administrator/root. If `corepack` is not found, you may need to install it first with `npm install --global corepack`

meteor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"object-path": "^0.11.8",
6767
"p-lazy": "^3.1.0",
6868
"semver": "^7.5.4",
69-
"superfly-timeline": "9.0.0",
69+
"superfly-timeline": "9.0.1",
7070
"threadedclass": "^1.2.2",
7171
"timecode": "0.0.4",
7272
"type-fest": "^3.13.1",

meteor/server/api/client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export namespace ServerClientAPI {
6464
userEvent,
6565
eventTime,
6666
`worker.${jobName}`,
67-
[jobArguments],
67+
jobArguments as any,
6868
async (_credentials, userActionMetadata) => {
6969
checkArgs()
7070

@@ -91,7 +91,7 @@ export namespace ServerClientAPI {
9191
userEvent,
9292
eventTime,
9393
`worker.${jobName}`,
94-
[jobArguments],
94+
jobArguments as any,
9595
async (_credentials, userActionMetadata) => {
9696
checkArgs()
9797

@@ -111,7 +111,7 @@ export namespace ServerClientAPI {
111111
playlistId: RundownPlaylistId,
112112
checkArgs: () => void,
113113
methodName: string,
114-
args: any[],
114+
args: Record<string, unknown>,
115115
fcn: (access: VerifiedRundownPlaylistContentAccess) => Promise<T>
116116
): Promise<ClientAPI.ClientResponse<T>> {
117117
return runUserActionInLog(context, userEvent, eventTime, methodName, args, async () => {
@@ -132,7 +132,7 @@ export namespace ServerClientAPI {
132132
rundownId: RundownId,
133133
checkArgs: () => void,
134134
methodName: string,
135-
args: any[],
135+
args: Record<string, unknown>,
136136
fcn: (access: VerifiedRundownContentAccess) => Promise<T>
137137
): Promise<ClientAPI.ClientResponse<T>> {
138138
return runUserActionInLog(context, userEvent, eventTime, methodName, args, async () => {
@@ -184,7 +184,7 @@ export namespace ServerClientAPI {
184184
userEvent: string,
185185
eventTime: Time,
186186
methodName: string,
187-
methodArgs: unknown[],
187+
methodArgs: Record<string, unknown>,
188188
fcn: (credentials: BasicAccessContext, userActionMetadata: UserActionMetadata) => Promise<TRes>
189189
): Promise<ClientAPI.ClientResponse<TRes>> {
190190
// If we are in the test write auth check mode, then bypass all special logic to ensure errors dont get mangled

meteor/server/api/ingest/mosDevice/actions.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { generateRundownSource, getPeripheralDeviceFromRundown, runIngestOperati
1313
import { IngestJobs } from '@sofie-automation/corelib/dist/worker/ingest'
1414
import { DEFAULT_MOS_TIMEOUT_TIME } from '@sofie-automation/shared-lib/dist/core/constants'
1515
import { executePeripheralDeviceFunctionWithCustomTimeout } from '../../peripheralDevice/executeFunction'
16+
import { getMosTypes } from '@mos-connection/helper'
1617

1718
export namespace MOSDeviceActions {
1819
export async function reloadRundown(
@@ -72,9 +73,15 @@ export namespace MOSDeviceActions {
7273
if (!mosPayload.Body)
7374
throw new Meteor.Error(500, `Part Cache for "${partCache.externalId}" missing FullStory content!`)
7475

75-
const story = mosPayload.Body.filter(
76-
(item) => item.Type === 'storyItem' && item.Content.ID === piece.externalId
77-
)[0].Content
76+
const mosTypes = getMosTypes(false)
77+
78+
const story = mosPayload.Body.find(
79+
(item) =>
80+
item.itemType === 'storyItem' && mosTypes.mosString128.stringify(item.Content.ID) === piece.externalId
81+
)?.Content as MOS.IMOSItem | undefined
82+
83+
if (!story) throw new Meteor.Error(404, `Story "${piece.externalId}" not found in mosPayload`)
84+
7885
const timeBase = story.TimeBase || 1
7986
const modifiedFields = {
8087
EditorialStart: (inPoint * timeBase) as number | undefined,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class BucketsServerAPI implements BucketsRestAPI {
5252
event,
5353
getCurrentTime(),
5454
'bucketsCreateNewBucket',
55-
[bucket],
55+
{ bucket },
5656
async () => {
5757
check(bucket.studioId, String)
5858
check(bucket.name, String)
@@ -80,7 +80,7 @@ export class BucketsServerAPI implements BucketsRestAPI {
8080
event,
8181
getCurrentTime(),
8282
'bucketsRemoveBucket',
83-
[bucketId],
83+
{ bucketId },
8484
async () => {
8585
check(bucketId, String)
8686

@@ -100,7 +100,7 @@ export class BucketsServerAPI implements BucketsRestAPI {
100100
event,
101101
getCurrentTime(),
102102
'bucketsEmptyBucket',
103-
[bucketId],
103+
{ bucketId },
104104
async () => {
105105
check(bucketId, String)
106106

@@ -120,7 +120,7 @@ export class BucketsServerAPI implements BucketsRestAPI {
120120
event,
121121
getCurrentTime(),
122122
'bucketsRemoveBucketAdLib',
123-
[externalId],
123+
{ externalId },
124124
async () => {
125125
const bucketAdLibPiecePromise = BucketAdLibs.findOneAsync(
126126
{ externalId },
@@ -167,7 +167,7 @@ export class BucketsServerAPI implements BucketsRestAPI {
167167
event,
168168
getCurrentTime(),
169169
'bucketAdlibImport',
170-
[bucketId, showStyleBaseId, ingestItem],
170+
{ bucketId, showStyleBaseId, ingestItem },
171171
async () => {
172172
check(bucketId, String)
173173
check(showStyleBaseId, String)

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

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class PlaylistsServerAPI implements PlaylistsRestAPI {
330330
check(rundownPlaylistId, String)
331331
},
332332
'reloadPlaylist',
333-
[rundownPlaylistId],
333+
{ rundownPlaylistId },
334334
async (access) => {
335335
const reloadResponse = await ServerRundownAPI.resyncRundownPlaylist(access)
336336
const success = !reloadResponse.rundownsResponses.reduce((missing, rundownsResponse) => {
@@ -458,11 +458,11 @@ class PlaylistsServerAPI implements PlaylistsRestAPI {
458458
)
459459
}
460460

461-
async clearSourceLayer(
461+
async clearSourceLayers(
462462
connection: Meteor.Connection,
463463
event: string,
464464
rundownPlaylistId: RundownPlaylistId,
465-
sourceLayerId: string
465+
sourceLayerIds: string[]
466466
): Promise<ClientAPI.ClientResponse<void>> {
467467
const rundownPlaylist = await RundownPlaylists.findOneAsync(rundownPlaylistId)
468468
if (!rundownPlaylist)
@@ -489,13 +489,13 @@ class PlaylistsServerAPI implements PlaylistsRestAPI {
489489
rundownPlaylistId,
490490
() => {
491491
check(rundownPlaylistId, String)
492-
check(sourceLayerId, String)
492+
check(sourceLayerIds, [String])
493493
},
494494
StudioJobs.StopPiecesOnSourceLayers,
495495
{
496496
playlistId: rundownPlaylistId,
497497
partInstanceId: rundownPlaylist.currentPartInfo.partInstanceId,
498-
sourceLayerIds: [sourceLayerId],
498+
sourceLayerIds: sourceLayerIds,
499499
}
500500
)
501501
}
@@ -786,6 +786,26 @@ export function registerRoutes(registerRoute: APIRegisterHook<PlaylistsRestAPI>)
786786
}
787787
)
788788

789+
registerRoute<{ playlistId: string }, { sourceLayerIds: string[] }, void>(
790+
'put',
791+
'/playlists/:playlistId/clear-sourcelayers',
792+
new Map([
793+
[404, [UserErrorMessage.RundownPlaylistNotFound]],
794+
[412, [UserErrorMessage.InactiveRundown]],
795+
]),
796+
playlistsAPIFactory,
797+
async (serverAPI, connection, event, params, body) => {
798+
const playlistId = protectString<RundownPlaylistId>(params.playlistId)
799+
const sourceLayerIds = body?.sourceLayerIds
800+
logger.info(`API POST: clear-sourcelayers ${playlistId} ${sourceLayerIds}`)
801+
802+
check(playlistId, String)
803+
check(sourceLayerIds, Array<String>)
804+
805+
return await serverAPI.clearSourceLayers(connection, event, playlistId, sourceLayerIds)
806+
}
807+
)
808+
789809
registerRoute<{ playlistId: string; sourceLayerId: string }, never, void>(
790810
'delete',
791811
'/playlists/:playlistId/sourceLayer/:sourceLayerId',
@@ -801,7 +821,7 @@ export function registerRoutes(registerRoute: APIRegisterHook<PlaylistsRestAPI>)
801821

802822
check(playlistId, String)
803823
check(sourceLayerId, String)
804-
return await serverAPI.clearSourceLayer(connection, event, playlistId, sourceLayerId)
824+
return await serverAPI.clearSourceLayers(connection, event, playlistId, [sourceLayerId])
805825
}
806826
)
807827

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class StudiosServerAPI implements StudiosRestAPI {
176176
event,
177177
getCurrentTime(),
178178
'switchRouteSet',
179-
[studioId, routeSetId, state],
179+
{ studioId, routeSetId, state },
180180
async () => {
181181
check(studioId, String)
182182
check(routeSetId, String)

0 commit comments

Comments
 (0)