Skip to content

Commit e52379b

Browse files
committed
Merge branch 'release53' into pr/ianshade/1371
2 parents 52603a5 + ea7439c commit e52379b

File tree

74 files changed

+1145
-720
lines changed

Some content is hidden

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

74 files changed

+1145
-720
lines changed

meteor/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "automation-core",
3-
"version": "1.52.0-in-testing.0",
3+
"version": "1.53.0-in-development",
44
"private": true,
55
"engines": {
66
"node": ">=22.11"
@@ -103,7 +103,7 @@
103103
"eslint-plugin-node": "^11.1.0",
104104
"eslint-plugin-prettier": "^4.2.1",
105105
"fast-clone": "^1.5.13",
106-
"glob": "^8.1.0",
106+
"glob": "^11.0.1",
107107
"i18next-conv": "^10.2.0",
108108
"i18next-scanner": "^4.6.0",
109109
"jest": "^29.7.0",

meteor/scripts/extract-i18next-pot.mjs

+2-5
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727
* SOFTWARE.
2828
*/
2929

30-
import { promisify } from 'util'
3130
import fs from 'fs'
3231
import yargs from 'yargs'
3332
import { Parser } from 'i18next-scanner'
3433
import converter from 'i18next-conv'
35-
import glob from 'glob'
34+
import { glob } from 'glob'
3635

3736
const args = yargs(process.argv)
3837
.option('files', {
@@ -66,8 +65,6 @@ const args = yargs(process.argv)
6665
.help()
6766
.alias('help', 'h').argv
6867

69-
const pGlob = promisify(glob)
70-
7168
const parserOptions = {
7269
// Include react helpers into parsing
7370
attr: {
@@ -101,7 +98,7 @@ console.log('Extracting translatable strings...')
10198
console.log('This process may print out some error messages, but the translation template should work fine.')
10299
console.log('──────\n')
103100

104-
const files = await pGlob(fileGlob)
101+
const files = await glob(fileGlob)
105102

106103
// console.debug('Loading content of ' + files.length + ' files')
107104

meteor/scripts/i18n-compile-json.mjs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { promisify } from 'util'
2-
import glob from 'glob'
1+
import { glob } from 'glob'
32
import { spawn } from 'child_process'
43

5-
const pGlob = promisify(glob)
6-
74
/*************************************************
85
96
This script goes through all of the languages (.po files)
@@ -14,7 +11,7 @@ and compiles the json-files (used in production).
1411
const errors = []
1512
const failedLanguages = []
1613
// List all po-files:
17-
const poFiles = await pGlob('./i18n/*.po')
14+
const poFiles = await glob('./i18n/*.po')
1815

1916
const languages = []
2017
for (const poFile of poFiles) {

meteor/server/api/buckets.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as _ from 'underscore'
22
import { Meteor } from 'meteor/meteor'
3-
import { Bucket } from '@sofie-automation/meteor-lib/dist/collections/Buckets'
3+
import { Bucket } from '@sofie-automation/corelib/dist/dataModel/Bucket'
44
import { getRandomId, getRandomString, literal } from '../lib/tempLib'
55
import { BucketAdLib } from '@sofie-automation/corelib/dist/dataModel/BucketAdLibPiece'
66
import { AdLibAction, AdLibActionCommon } from '@sofie-automation/corelib/dist/dataModel/AdlibAction'

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import {
5454
DEFAULT_MINIMUM_TAKE_SPAN,
5555
DEFAULT_FALLBACK_PART_DURATION,
5656
} from '@sofie-automation/shared-lib/dist/core/constants'
57-
import { Bucket } from '@sofie-automation/meteor-lib/dist/collections/Buckets'
57+
import { Bucket } from '@sofie-automation/corelib/dist/dataModel/Bucket'
5858
import { ForceQuickLoopAutoNext } from '@sofie-automation/shared-lib/dist/core/model/StudioSettings'
5959
import { PlaylistSnapshotOptions, SystemSnapshotOptions } from '@sofie-automation/meteor-lib/dist/api/shapshot'
6060

meteor/server/api/userActions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { MOSDeviceActions } from './ingest/mosDevice/actions'
1515
import { MethodContextAPI } from './methodContext'
1616
import { ServerClientAPI } from './client'
1717
import { triggerWriteAccessBecauseNoCheckNecessary } from '../security/securityVerify'
18-
import { Bucket } from '@sofie-automation/meteor-lib/dist/collections/Buckets'
18+
import { Bucket } from '@sofie-automation/corelib/dist/dataModel/Bucket'
1919
import { BucketsAPI } from './buckets'
2020
import { BucketAdLib } from '@sofie-automation/corelib/dist/dataModel/BucketAdLibPiece'
2121
import { AdLibActionCommon } from '@sofie-automation/corelib/dist/dataModel/AdlibAction'

meteor/server/collections/bucket.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BucketAdLibAction } from '@sofie-automation/corelib/dist/dataModel/BucketAdLibAction'
22
import { BucketAdLib } from '@sofie-automation/corelib/dist/dataModel/BucketAdLibPiece'
33
import { CollectionName } from '@sofie-automation/corelib/dist/dataModel/Collections'
4-
import { Bucket } from '@sofie-automation/meteor-lib/dist/collections/Buckets'
4+
import { Bucket } from '@sofie-automation/corelib/dist/dataModel/Bucket'
55
import { createAsyncOnlyMongoCollection } from './collection'
66
import { registerIndex } from './indices'
77

meteor/server/migration/1_52_0.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CoreSystem, PeripheralDevices, Studios, TriggeredActions } from '../col
33
import {
44
convertObjectIntoOverrides,
55
ObjectOverrideSetOp,
6+
ObjectWithOverrides,
67
wrapDefaultObject,
78
} from '@sofie-automation/corelib/dist/settings/objectWithOverrides'
89
import {
@@ -268,7 +269,9 @@ export const addSteps = addMigrationSteps('1.52.0', [
268269
//@ts-expect-error settings is typed as Record<string, StudioRouteSet>
269270
const oldSettings = studio.settings
270271

271-
const newSettings = wrapDefaultObject<IStudioSettings>(oldSettings || {})
272+
const newSettings = convertObjectIntoOverrides(
273+
oldSettings || {}
274+
) as unknown as ObjectWithOverrides<IStudioSettings>
272275

273276
await Studios.updateAsync(studio._id, {
274277
$set: {
@@ -304,7 +307,7 @@ export const addSteps = addMigrationSteps('1.52.0', [
304307
for (const system of systems) {
305308
const oldSystem = system as ICoreSystem as PartialOldICoreSystem
306309

307-
const newSettings = wrapDefaultObject<ICoreSystemSettings>({
310+
const newSettings = convertObjectIntoOverrides({
308311
cron: {
309312
casparCGRestart: {
310313
enabled: false,
@@ -316,7 +319,7 @@ export const addSteps = addMigrationSteps('1.52.0', [
316319
},
317320
support: oldSystem.support ?? { message: '' },
318321
evaluationsMessage: oldSystem.evaluations ?? { enabled: false, heading: '', message: '' },
319-
})
322+
}) as unknown as ObjectWithOverrides<ICoreSystemSettings>
320323

321324
await CoreSystem.updateAsync(system._id, {
322325
$set: {

meteor/server/migration/currentSystemVersion.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
* 1.50.0: Release 50 (2024-02-23)
5252
* 1.51.0: Release 51 (TBD)
5353
* 1.52.0: Release 52 (TBD)
54+
* 1.53.0: Release 53 (TBD)
5455
*/
5556

5657
// Note: Only set this to release versions, (ie X.Y.Z), not pre-releases (ie X.Y.Z-0-pre-release)
57-
export const CURRENT_SYSTEM_VERSION = '1.52.0'
58+
export const CURRENT_SYSTEM_VERSION = '1.53.0'

meteor/server/publications/buckets.ts

+39-44
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import { FindOptions } from '@sofie-automation/meteor-lib/dist/collections/lib'
22
import { meteorPublish } from './lib/lib'
3-
import { MeteorPubSub } from '@sofie-automation/meteor-lib/dist/api/pubsub'
4-
import { Bucket } from '@sofie-automation/meteor-lib/dist/collections/Buckets'
3+
import { Bucket } from '@sofie-automation/corelib/dist/dataModel/Bucket'
54
import { BucketAdLibActions, BucketAdLibs, Buckets } from '../collections'
65
import { check, Match } from 'meteor/check'
76
import { StudioId, BucketId, ShowStyleVariantId } from '@sofie-automation/corelib/dist/dataModel/Ids'
87
import { CorelibPubSub } from '@sofie-automation/corelib/dist/pubsub'
98
import { triggerWriteAccessBecauseNoCheckNecessary } from '../security/securityVerify'
9+
import { MongoQuery } from '@sofie-automation/corelib/dist/mongo'
10+
import { BucketAdLib } from '@sofie-automation/corelib/dist/dataModel/BucketAdLibPiece'
11+
import { BucketAdLibAction } from '@sofie-automation/corelib/dist/dataModel/BucketAdLibAction'
1012

1113
meteorPublish(
12-
MeteorPubSub.buckets,
14+
CorelibPubSub.buckets,
1315
async function (studioId: StudioId, bucketId: BucketId | null, _token: string | undefined) {
1416
check(studioId, String)
1517
check(bucketId, Match.Maybe(String))
@@ -20,68 +22,61 @@ meteorPublish(
2022
fields: {},
2123
}
2224

23-
return Buckets.findWithCursor(
24-
bucketId
25-
? {
26-
_id: bucketId,
27-
studioId,
28-
}
29-
: {
30-
studioId,
31-
},
32-
modifier
33-
)
25+
const selector: MongoQuery<Bucket> = {
26+
studioId,
27+
}
28+
if (bucketId) selector._id = bucketId
29+
30+
return Buckets.findWithCursor(selector, modifier)
3431
}
3532
)
3633

3734
meteorPublish(
3835
CorelibPubSub.bucketAdLibPieces,
39-
async function (studioId: StudioId, bucketId: BucketId, showStyleVariantIds: ShowStyleVariantId[]) {
36+
async function (studioId: StudioId, bucketId: BucketId | null, showStyleVariantIds: ShowStyleVariantId[]) {
4037
check(studioId, String)
41-
check(bucketId, String)
38+
check(bucketId, Match.Maybe(String))
4239
check(showStyleVariantIds, Array)
4340

4441
triggerWriteAccessBecauseNoCheckNecessary()
4542

46-
return BucketAdLibs.findWithCursor(
47-
{
48-
studioId: studioId,
49-
bucketId: bucketId,
50-
showStyleVariantId: {
51-
$in: [null, ...showStyleVariantIds], // null = valid for all variants
52-
},
43+
const selector: MongoQuery<BucketAdLib> = {
44+
studioId: studioId,
45+
showStyleVariantId: {
46+
$in: [null, ...showStyleVariantIds], // null = valid for all variants
47+
},
48+
}
49+
if (bucketId) selector.bucketId = bucketId
50+
51+
return BucketAdLibs.findWithCursor(selector, {
52+
fields: {
53+
ingestInfo: 0, // This is a large blob, and is not of interest to the UI
5354
},
54-
{
55-
fields: {
56-
ingestInfo: 0, // This is a large blob, and is not of interest to the UI
57-
},
58-
}
59-
)
55+
})
6056
}
6157
)
6258

6359
meteorPublish(
6460
CorelibPubSub.bucketAdLibActions,
65-
async function (studioId: StudioId, bucketId: BucketId, showStyleVariantIds: ShowStyleVariantId[]) {
61+
async function (studioId: StudioId, bucketId: BucketId | null, showStyleVariantIds: ShowStyleVariantId[]) {
6662
check(studioId, String)
67-
check(bucketId, String)
63+
check(bucketId, Match.Maybe(String))
6864
check(showStyleVariantIds, Array)
6965

7066
triggerWriteAccessBecauseNoCheckNecessary()
7167

72-
return BucketAdLibActions.findWithCursor(
73-
{
74-
studioId: studioId,
75-
bucketId: bucketId,
76-
showStyleVariantId: {
77-
$in: [null, ...showStyleVariantIds], // null = valid for all variants
78-
},
68+
const selector: MongoQuery<BucketAdLibAction> = {
69+
studioId: studioId,
70+
showStyleVariantId: {
71+
$in: [null, ...showStyleVariantIds], // null = valid for all variants
72+
},
73+
}
74+
if (bucketId) selector.bucketId = bucketId
75+
76+
return BucketAdLibActions.findWithCursor(selector, {
77+
fields: {
78+
ingestInfo: 0, // This is a large blob, and is not of interest to the UI
7979
},
80-
{
81-
fields: {
82-
ingestInfo: 0, // This is a large blob, and is not of interest to the UI
83-
},
84-
}
85-
)
80+
})
8681
}
8782
)

meteor/server/publications/pieceContentStatusUI/bucket/publication.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
SetupObserversResult,
2323
} from '../../../lib/customPublication'
2424
import { BucketContentCache, createReactiveContentCache } from './bucketContentCache'
25-
import { Bucket } from '@sofie-automation/meteor-lib/dist/collections/Buckets'
25+
import { Bucket } from '@sofie-automation/corelib/dist/dataModel/Bucket'
2626
import {
2727
addItemsWithDependenciesChangesToChangedSet,
2828
fetchStudio,

0 commit comments

Comments
 (0)