Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
migrate: () => {
let device = PeripheralDevices.findOne({type: PeripheralDeviceAPI.DeviceType.PLAYOUT})
if (device) {
// Set some default values:
let lawo0 = device.settings && device.settings.devices['lawo0']
if (!lawo0) {
logger.info(`Migration: Add PeripheralDevice.settings to ${device._id}: lawo0`)
PeripheralDevices.update(device._id, {$set: {
'settings.devices.lawo0': {
type: PlayoutDeviceType.LAWO,
options: {
host: '',
port: 9910,
}
}
}})
}
}
},
input: [{
validate: () => {
let device = PeripheralDevices.findOne({type: PeripheralDeviceAPI.DeviceType.PLAYOUT})
if (!device) return 'Playout-gateway not found'
let settings = device.settings || {devices: {}} as PlayoutDeviceSettings
let lawo0 = settings.devices['lawo0'] as PlayoutDeviceSettingsDevice
if (!lawo0) return '"lawo0" missing'
if (lawo0.type !== PlayoutDeviceType.LAWO) return 'Type is not "LAWO"'
return false
},
migrate: () => {
options: {
host: '',
port: 5250,
launcherHost: '',
launcherPort: 8005
}
},
'settings.devices.atem0': ((pd['settings'] || {})['devices'] || {})['atem0'] || {
type: PlayoutDeviceType.ATEM,
options: {
host: '160.67.87.51',
port: 9910
}
},
'settings.devices.lawo0': ((pd['settings'] || {})['devices'] || {})['lawo0'] || {
type: PlayoutDeviceType.LAWO,
options: {
host: '160.67.96.51',
port: 9000,
sourcesPath: 'Sapphire.Sources',
rampMotorFunctionPath: '1.5.2'
}
},
'settings.devices.abstract0': ((pd['settings'] || {})['devices'] || {})['abstract0'] || {
type: PlayoutDeviceType.ABSTRACT,
options: {
}
},
'settings.devices.http0': ((pd['settings'] || {})['devices'] || {})['http0'] || {
type: PlayoutDeviceType.HTTPSEND,
options: {
}