Skip to content

Commit 58c9656

Browse files
authored
Merge pull request nrkno#1383 from nrkno/fix/sofie-3798/migrations
fix: Studio migrations (SOFIE-3798)
2 parents a0fe909 + dbc3bca commit 58c9656

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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: {

0 commit comments

Comments
 (0)