Skip to content

Commit a4439e9

Browse files
committed
wip: missed references
1 parent 2cdd8d3 commit a4439e9

File tree

15 files changed

+29
-20
lines changed

15 files changed

+29
-20
lines changed

meteor/server/api/packageManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function abortExpectation(deviceId: PeripheralDeviceId, workId: str
1616

1717
export async function restartAllExpectationsInStudio(studioId: StudioId): Promise<void> {
1818
const packageManagerDevices = await PeripheralDevices.findFetchAsync({
19-
studioId: studioId,
19+
'studioAndConfigId.studioId': studioId,
2020
category: PeripheralDeviceCategory.PACKAGE_MANAGER,
2121
type: PeripheralDeviceType.PACKAGE_MANAGER,
2222
subType: PERIPHERAL_SUBTYPE_PROCESS,

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ class StudiosServerAPI implements StudiosRestAPI {
134134
}
135135
}
136136

137-
await PeripheralDevices.updateAsync({ studioId }, { $unset: { studioId: 1 } }, { multi: true })
137+
await PeripheralDevices.updateAsync(
138+
{ 'studioAndConfigId.studioId': studioId },
139+
{ $unset: { studioAndConfigId: 1 } },
140+
{ multi: true }
141+
)
138142

139143
const rundownPlaylists = (await RundownPlaylists.findFetchAsync(
140144
{ studioId },
@@ -198,7 +202,7 @@ class StudiosServerAPI implements StudiosRestAPI {
198202
studioId: StudioId
199203
): Promise<ClientAPI.ClientResponse<Array<{ id: string }>>> {
200204
const peripheralDevices = (await PeripheralDevices.findFetchAsync(
201-
{ studioId },
205+
{ 'studioAndConfigId.studioId': studioId },
202206
{ projection: { _id: 1 } }
203207
)) as Array<Pick<PeripheralDevice, '_id'>>
204208

meteor/server/api/snapshot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ async function createSystemSnapshot(
184184
queryRundownLayouts = { showStyleBaseId: { $in: showStyleBaseIds } }
185185
queryTriggeredActions = { showStyleBaseIds: { $in: [null, ...showStyleBaseIds] } }
186186

187-
if (studioId) queryDevices = { studioId: studioId }
187+
if (studioId) queryDevices = { 'studioAndConfigId.studioId': studioId }
188188
else if (organizationId) queryDevices = { organizationId: organizationId }
189189

190190
const [showStyleVariants, rundownLayouts, devices, triggeredActions] = await Promise.all([
@@ -623,7 +623,7 @@ async function restoreFromSystemSnapshot(snapshot: SystemSnapshot): Promise<void
623623
snapshot.blueprints ? saveIntoDb(Blueprints, {}, snapshot.blueprints) : null,
624624
snapshot.rundownLayouts ? saveIntoDb(RundownLayouts, {}, snapshot.rundownLayouts) : null,
625625
snapshot.triggeredActions ? saveIntoDb(TriggeredActions, {}, snapshot.triggeredActions) : null,
626-
saveIntoDb(PeripheralDevices, studioId ? { studioId: studioId } : {}, snapshot.devices),
626+
saveIntoDb(PeripheralDevices, studioId ? { 'studioAndConfigId.studioId': studioId } : {}, snapshot.devices),
627627
saveIntoDb(CoreSystem, {}, [snapshot.coreSystem]),
628628
]))
629629
)

meteor/server/api/studio/api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ async function removeStudio(context: MethodContext, studioId: StudioId): Promise
9090
`Can't remove studio "${studioId}", because the rundownPlaylist "${playlist._id}" is in it.`
9191
)
9292

93-
const peripheralDevice = await PeripheralDevices.findOneAsync({ studioId: studio._id }, { fields: { _id: 1 } })
93+
const peripheralDevice = await PeripheralDevices.findOneAsync(
94+
{ 'studioAndConfigId.studioId': studio._id },
95+
{ fields: { _id: 1 } }
96+
)
9497
if (peripheralDevice)
9598
throw new Meteor.Error(
9699
404,

meteor/server/publications/peripheralDevice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ meteorPublish(CorelibPubSub.peripheralDevicesAndSubDevices, async function (stud
4949
triggerWriteAccessBecauseNoCheckNecessary()
5050

5151
const selector: MongoQuery<PeripheralDevice> = {
52-
studioId,
52+
'studioAndConfigId.studioId': studioId,
5353
}
5454

5555
// TODO - this is not correctly reactive when changing the `studioId` property of a parent device

meteor/server/systemStatus/systemStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export async function getSystemStatus(_cred: RequestCredentials | null, studioId
248248
if (studioId) {
249249
// Check status for a certain studio:
250250

251-
devices = await PeripheralDevices.findFetchAsync({ studioId: studioId })
251+
devices = await PeripheralDevices.findFetchAsync({ 'studioAndConfigId.studioId': studioId })
252252
} else {
253253
// Check status for all studios:
254254

packages/job-worker/src/__mocks__/presetCollections.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,10 @@ export async function setupMockPeripheralDevice(
420420
name: 'mockDevice',
421421
deviceName: 'Mock Gateway',
422422
organizationId: null,
423-
studioId: context.studioId,
424-
settings: {},
423+
studioAndConfigId: {
424+
studioId: context.studioId,
425+
configId: 'test',
426+
},
425427
nrcsName: category === PeripheralDeviceCategory.INGEST ? 'JEST-NRCS' : undefined,
426428

427429
category: category,

packages/job-worker/src/events/handle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export async function handleNotifyCurrentlyPlayingPart(
256256
}
257257
const parentDevice = await context.directCollections.PeripheralDevices.findOne({
258258
_id: device.parentDeviceId,
259-
studioId: context.studioId,
259+
'studioAndConfigId.studioId': context.studioId,
260260
parentDeviceId: { $exists: false },
261261
})
262262
if (!parentDevice) {

packages/job-worker/src/playout/model/implementation/LoadPlayoutModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export async function loadPlayoutModelPreInit(
4545
}
4646

4747
const [PeripheralDevices, Playlist, Rundowns] = await Promise.all([
48-
context.directCollections.PeripheralDevices.findFetch({ studioId: tmpPlaylist.studioId }),
48+
context.directCollections.PeripheralDevices.findFetch({ 'studioAndConfigId.studioId': tmpPlaylist.studioId }),
4949
reloadPlaylist ? context.directCollections.RundownPlaylists.findOne(tmpPlaylist._id) : clone(tmpPlaylist),
5050
context.directCollections.Rundowns.findFetch({ playlistId: tmpPlaylist._id }),
5151
])
@@ -120,7 +120,7 @@ async function loadInitData(
120120
existingRundowns: ReadonlyDeep<DBRundown[]> | undefined
121121
): Promise<[ReadonlyDeep<PeripheralDevice[]>, DBRundownPlaylist, ReadonlyDeep<DBRundown[]>]> {
122122
const [peripheralDevices, reloadedPlaylist, rundowns] = await Promise.all([
123-
context.directCollections.PeripheralDevices.findFetch({ studioId: tmpPlaylist.studioId }),
123+
context.directCollections.PeripheralDevices.findFetch({ 'studioAndConfigId.studioId': tmpPlaylist.studioId }),
124124
reloadPlaylist
125125
? await context.directCollections.RundownPlaylists.findOne(tmpPlaylist._id)
126126
: clone<DBRundownPlaylist>(tmpPlaylist),

packages/job-worker/src/studio/model/StudioPlayoutModelImpl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export async function loadStudioPlayoutModel(
177177
const studioId = context.studioId
178178

179179
const collections = await Promise.all([
180-
context.directCollections.PeripheralDevices.findFetch({ studioId }),
180+
context.directCollections.PeripheralDevices.findFetch({ 'studioAndConfigId.studioId': studioId }),
181181
context.directCollections.RundownPlaylists.findFetch({ studioId }),
182182
context.directCollections.Timelines.findOne(studioId),
183183
])

0 commit comments

Comments
 (0)