-
Notifications
You must be signed in to change notification settings - Fork 2
/
upgrades.js
57 lines (49 loc) · 1.29 KB
/
upgrades.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
export const upgradeScripts = [
function upgrade300(context, props) {
const changes = {
updatedConfig: null,
updatedActions: [],
updatedFeedbacks: [],
}
if (props.config) {
let config = props.config
if (config.info !== undefined) {
delete config.info
}
if (config.deviceIp !== undefined) {
config.host = config.deviceIp
delete config.deviceIp
}
changes.updatedConfig = config
}
for (let action of props.actions) {
if (action.options === undefined) {
action.options = {}
}
switch (action.actionId) {
case 'changeNDISource':
if (action.options.source === 'No sources found') {
action.options.source = 'None'
} else {
action.options.source = action.options.source
}
action.actionId = 'changeDecodeSource'
changes.updatedActions.push(action)
break
case 'changeNDISourceIP':
action.options.source = action.options.ndiSource
action.actionId = 'changeDecodeSource'
delete action.options.ndiSource
delete action.options.ndiSourcePort
delete action.options.ndiSourceIp
changes.updatedActions.push(action)
break
case 'refreshNDISourceList':
action.actionId = 'refreshSourceList'
changes.updatedActions.push(action)
break
}
}
return changes
},
]