Skip to content

Commit 9e79a9a

Browse files
committed
Merge branch 'upstream/release53' into bbc-release53
2 parents c83d4ef + b868b75 commit 9e79a9a

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

+814
-818
lines changed

meteor/server/api/blueprintConfigPresets.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Meteor.startup(async () => {
3535

3636
const blueprint = (await Blueprints.findOneAsync(
3737
{ _id: doc.blueprintId, blueprintType: BlueprintManifestType.STUDIO },
38-
{ fields: { _id: 1, studioConfigPresets: 1 } }
38+
{ projection: { _id: 1, studioConfigPresets: 1 } }
3939
)) as Pick<Blueprint, '_id' | 'studioConfigPresets'> | undefined
4040

4141
if (!blueprint?.studioConfigPresets) {
@@ -100,7 +100,7 @@ Meteor.startup(async () => {
100100

101101
const blueprint = (await Blueprints.findOneAsync(
102102
{ _id: doc.blueprintId, blueprintType: BlueprintManifestType.SHOWSTYLE },
103-
{ fields: { _id: 1, showStyleConfigPresets: 1 } }
103+
{ projection: { _id: 1, showStyleConfigPresets: 1 } }
104104
)) as Pick<Blueprint, '_id' | 'showStyleConfigPresets'> | undefined
105105

106106
if (!blueprint?.showStyleConfigPresets) {
@@ -116,7 +116,7 @@ Meteor.startup(async () => {
116116

117117
const variants = (await ShowStyleVariants.findFetchAsync(
118118
{ showStyleBaseId: doc._id },
119-
{ fields: { blueprintConfigPresetId: 1 } }
119+
{ projection: { blueprintConfigPresetId: 1 } }
120120
)) as Pick<DBShowStyleVariant, '_id' | 'blueprintConfigPresetId'>[]
121121

122122
const ps: Promise<unknown>[] = [
@@ -188,7 +188,7 @@ Meteor.startup(async () => {
188188

189189
const blueprint = (await Blueprints.findOneAsync(
190190
{ _id: showStyleBase.blueprintId, blueprintType: BlueprintManifestType.SHOWSTYLE },
191-
{ fields: { _id: 1, showStyleConfigPresets: 1 } }
191+
{ projection: { _id: 1, showStyleConfigPresets: 1 } }
192192
)) as Pick<Blueprint, '_id' | 'showStyleConfigPresets'> | undefined
193193

194194
if (!blueprint?.showStyleConfigPresets) {

meteor/server/api/blueprints/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ async function syncConfigPresetsToShowStyles(blueprint: Blueprint): Promise<void
261261
const showStyles = (await ShowStyleBases.findFetchAsync(
262262
{ blueprintId: blueprint._id },
263263
{
264-
fields: {
264+
projection: {
265265
_id: 1,
266266
blueprintConfigPresetId: 1,
267267
},
@@ -295,7 +295,7 @@ async function syncConfigPresetsToShowStyles(blueprint: Blueprint): Promise<void
295295
const variants = (await ShowStyleVariants.findFetchAsync(
296296
{ showStyleBaseId: { $in: showStyles.map((s) => s._id) } },
297297
{
298-
fields: {
298+
projection: {
299299
_id: 1,
300300
showStyleBaseId: 1,
301301
blueprintConfigPresetId: 1,
@@ -328,7 +328,7 @@ async function syncConfigPresetsToStudios(blueprint: Blueprint): Promise<void> {
328328
const studios = (await Studios.findFetchAsync(
329329
{ blueprintId: blueprint._id },
330330
{
331-
fields: {
331+
projection: {
332332
_id: 1,
333333
blueprintConfigPresetId: 1,
334334
},

meteor/server/api/buckets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export namespace BucketsAPI {
8989
sort: {
9090
_rank: 1,
9191
},
92-
fields: {
92+
projection: {
9393
_rank: 1,
9494
},
9595
}

meteor/server/api/cleanup.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export async function cleanupOldDataInner(actuallyCleanup = false): Promise<Coll
107107
): Promise<ID[]> => {
108108
const collectionName = getCollectionKey(collection)
109109

110-
const ids = (await collection.findFetchAsync(query, { fields: { _id: 1 } })).map((doc) => doc._id)
110+
const ids = (await collection.findFetchAsync(query, { projection: { _id: 1 } })).map((doc) => doc._id)
111111
const count = ids.length
112112
if (actuallyCleanup) {
113113
await collection.mutableCollection.removeAsync(query)
@@ -354,7 +354,7 @@ export async function cleanupOldDataInner(actuallyCleanup = false): Promise<Coll
354354
},
355355
],
356356
},
357-
{ fields: { _id: 1 } }
357+
{ projection: { _id: 1 } }
358358
)
359359
const emiFromRundowns = await ExpectedMediaItems.findFetchAsync(
360360
{
@@ -368,7 +368,7 @@ export async function cleanupOldDataInner(actuallyCleanup = false): Promise<Coll
368368
},
369369
],
370370
},
371-
{ fields: { _id: 1 } }
371+
{ projection: { _id: 1 } }
372372
)
373373
addToResult(CollectionName.ExpectedMediaItems, emiFromBuckets.length)
374374
addToResult(CollectionName.ExpectedMediaItems, emiFromRundowns.length)
@@ -481,7 +481,7 @@ async function isAllowedToRunCleanup(): Promise<string | void> {
481481
// HACK: TODO - should we check this?
482482
// if (isAnyQueuedWorkRunning()) return `Another sync-function is running, try again later`
483483

484-
const studios = await Studios.findFetchAsync({}, { fields: { _id: 1 } })
484+
const studios = await Studios.findFetchAsync({}, { projection: { _id: 1 } })
485485
for (const studio of studios) {
486486
const activePlaylist: DBRundownPlaylist | undefined = (
487487
await getActiveRundownPlaylistsInStudioFromDb(studio._id)
@@ -500,7 +500,7 @@ async function getAllIdsInCollection<DBInterface extends { _id: ID }, ID extends
500500
await collection.findFetchAsync(
501501
{},
502502
{
503-
fields: {
503+
projection: {
504504
_id: 1,
505505
},
506506
}

meteor/server/api/deviceTriggers/StudioObserver.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,17 @@ export class StudioObserver extends EventEmitter {
147147
.next(
148148
'currentRundown',
149149
async () =>
150-
Rundowns.findWithCursor({ _id: rundownId }, { fields: rundownFieldSpecifier, limit: 1 }) as Promise<
151-
MinimalMongoCursor<Pick<DBRundown, RundownFields>>
152-
>
150+
Rundowns.findWithCursor(
151+
{ _id: rundownId },
152+
{ projection: rundownFieldSpecifier, limit: 1 }
153+
) as Promise<MinimalMongoCursor<Pick<DBRundown, RundownFields>>>
153154
)
154155
.next('showStyleBase', async (chain) =>
155156
chain.currentRundown
156157
? (ShowStyleBases.findWithCursor(
157158
{ _id: chain.currentRundown.showStyleBaseId },
158159
{
159-
fields: showStyleBaseFieldSpecifier,
160+
projection: showStyleBaseFieldSpecifier,
160161
limit: 1,
161162
}
162163
) as Promise<MinimalMongoCursor<Pick<DBShowStyleBase, ShowStyleBaseFields>>>)

meteor/server/api/evaluations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export async function saveEvaluation(
6363
// only send message for evaluations with content
6464
if (evaluationMessage) {
6565
const playlist = (await RundownPlaylists.findOneAsync(evaluation.playlistId, {
66-
fields: {
66+
projection: {
6767
_id: 1,
6868
name: 1,
6969
},

meteor/server/api/ingest/rundownInput.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ Meteor.startup(async () => {
366366
added: onMediaObjectChanged,
367367
changed: onMediaObjectChanged,
368368
},
369-
{ fields: { _id: 1, mediaId: 1, mediainfo: 1, studioId: 1 } }
369+
{ projection: { _id: 1, mediaId: 1, mediainfo: 1, studioId: 1 } }
370370
)
371371
})
372372

@@ -382,7 +382,7 @@ async function onMediaObjectChanged(newDocument: MediaObject, oldDocument?: Medi
382382
oldDocument.mediainfo?.format?.duration !== newDocument.mediainfo.format.duration)
383383
) {
384384
const rundownIdsInStudio = (
385-
await Rundowns.findFetchAsync({ studioId: newDocument.studioId }, { fields: { _id: 1 } })
385+
await Rundowns.findFetchAsync({ studioId: newDocument.studioId }, { projection: { _id: 1 } })
386386
).map((rundown) => rundown._id)
387387

388388
const updateIds: MediaObjectUpdatedIds[] = (
@@ -392,7 +392,7 @@ async function onMediaObjectChanged(newDocument: MediaObject, oldDocument?: Medi
392392
'hackListenToMediaObjectUpdates.mediaId': newDocument.mediaId,
393393
},
394394
{
395-
fields: {
395+
projection: {
396396
rundownId: 1,
397397
segmentId: 1,
398398
},
@@ -415,7 +415,7 @@ async function onMediaObjectChanged(newDocument: MediaObject, oldDocument?: Medi
415415
rundownId: { $in: updateIds.map((obj) => obj.rundownId) },
416416
},
417417
{
418-
fields: {
418+
projection: {
419419
segmentId: 1,
420420
},
421421
}

meteor/server/api/integration/expectedPackages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export namespace PackageManagerIntegration {
363363
$or: [{ removeTime: null }, { removeTime: { $exists: false } }],
364364
},
365365
{
366-
fields: {
366+
projection: {
367367
payload: 0,
368368
},
369369
}

meteor/server/api/integration/media-scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export namespace MediaScannerIntegration {
2626
collectionId: collectionId,
2727
},
2828
{
29-
fields: {
29+
projection: {
3030
_id: 1,
3131
objId: 1,
3232
_rev: 1,

meteor/server/api/integration/mediaWorkFlows.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export namespace MediaManagerIntegration {
2828
studioId: peripheralDevice.studioAndConfigId.studioId,
2929
},
3030
{
31-
fields: {
31+
projection: {
3232
_id: 1,
3333
_rev: 1,
3434
},
@@ -60,7 +60,7 @@ export namespace MediaManagerIntegration {
6060
studioId: peripheralDevice.studioAndConfigId.studioId,
6161
},
6262
{
63-
fields: {
63+
projection: {
6464
_id: 1,
6565
_rev: 1,
6666
},

0 commit comments

Comments
 (0)