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 atem0 = device.settings && device.settings.devices['atem0']
if (!atem0) {
logger.info(`Migration: Add PeripheralDevice.settings to ${device._id}: atem0`)
PeripheralDevices.update(device._id, {$set: {
'settings.devices.atem0': {
type: PlayoutDeviceType.ATEM,
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 atem0 = settings.devices['atem0'] as PlayoutDeviceSettingsDeviceAtem
if (!atem0) return '"atem0" missing'
if (atem0.type !== PlayoutDeviceType.ATEM) return 'Type is not "ATEM"'
if (!atem0.options.host) return 'Host is not set'
return false
},
migrate: () => {
port: 5250,
launcherHost: '160.67.87.50',
launcherPort: 8005
}
},
'settings.devices.casparcg1': ((pd['settings'] || {})['devices'] || {})['casparcg1'] || {
type: PlayoutDeviceType.CASPARCG,
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,