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 http0 = device.settings && device.settings.devices['http0']
if (!http0) {
logger.info(`Migration: Add PeripheralDevice.settings to ${device._id}: http0`)
PeripheralDevices.update(device._id, {$set: {
'settings.devices.http0': {
type: PlayoutDeviceType.HTTPSEND,
options: {
host: '',
port: 9910,
}
}
}})
}
}
},
input: [{
})),
ensureStudioConfig('sources_kam_ptz', '1:ptz0'),
ensureDeviceVersion('ensureVersion.mosDevice', PeripheralDeviceAPI.DeviceType.MOSDEVICE, '_process', '0.1.1')
])
// 0.18.0: Release 4
addMigrationSteps( '0.18.0', [
removeMapping('nora_permanent_klokke'),
removeMapping('nora_permanent_logo'),
ensureMapping('nora_primary_klokke', literal({
device: PlayoutDeviceType.HTTPSEND,
deviceId: 'http0',
lookahead: LookaheadMode.NONE,
})),
ensureMapping('nora_primary_logo', literal({
device: PlayoutDeviceType.HTTPSEND,
deviceId: 'http0',
lookahead: LookaheadMode.NONE,
})),
removeMapping('casparcg_cg_permanent'),
{
id: 'mapping.casparcg_player_wipe.lookahead',
canBeRunAutomatically: true,
validate: () => {
let studio = StudioInstallations.findOne()
if (!studio) return 'Studio not found'
let dbMapping = studio.mappings['casparcg_player_wipe']
if (!dbMapping) return false
if (dbMapping.lookahead !== LookaheadMode.PRELOAD) return `Mapping "casparcg_player_wipe" wrong lookahead mode`
ensureMapping('ptz0_speed', literal({
device: PlayoutDeviceType.PANASONIC_PTZ,
deviceId: 'ptz0',
mappingType: MappingPanasonicPtzType.PRESET_SPEED,
lookahead: LookaheadMode.NONE,
})),
ensureStudioConfig('sources_kam_ptz', '1:ptz0'),
ensureDeviceVersion('ensureVersion.mosDevice', PeripheralDeviceAPI.DeviceType.MOSDEVICE, '_process', '0.1.1')
])
// 0.18.0: Release 4
addMigrationSteps( '0.18.0', [
removeMapping('nora_permanent_klokke'),
removeMapping('nora_permanent_logo'),
ensureMapping('nora_primary_klokke', literal({
device: PlayoutDeviceType.HTTPSEND,
deviceId: 'http0',
lookahead: LookaheadMode.NONE,
})),
ensureMapping('nora_primary_logo', literal({
device: PlayoutDeviceType.HTTPSEND,
deviceId: 'http0',
lookahead: LookaheadMode.NONE,
})),
removeMapping('casparcg_cg_permanent'),
{
id: 'mapping.casparcg_player_wipe.lookahead',
canBeRunAutomatically: true,
validate: () => {
let studio = StudioInstallations.findOne()
if (!studio) return 'Studio not found'
'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: {
}
},
'settings.devices.hyperdeck0': ((pd['settings'] || {})['devices'] || {})['hyperdeck0'] || {
type: PlayoutDeviceType.HYPERDECK,
options: {
host: '160.67.87.53',
port: 9993
}
},
}})
// PeripheralDevices.update(pd._id, {$set: {
// mappings: mappings
// }})
})
_.each(((PeripheralDevices.findOne('initDBPlayoutDeviceParent') || {})['settings'] || {}).devices, (device, key) => {
validate: () => {
let device = PeripheralDevices.findOne({type: PeripheralDeviceAPI.DeviceType.PLAYOUT})
if (!device) return 'Playout-gateway not found'
let settings = device.settings || {devices: {}} as PlayoutDeviceSettings
let http0 = settings.devices['http0'] as PlayoutDeviceSettingsDevice
if (!http0) return '"http0" missing'
if (http0.type !== PlayoutDeviceType.HTTPSEND) return 'Type is not "HTTPSEND"'
return false
},
migrate: () => {