forked from bitfocus/companion-module-figure53-qlab-advance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrades.js
85 lines (71 loc) · 1.81 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { CreateConvertToBooleanFeedbackUpgradeScript } from '@companion-module/base'
export const UpgradeScripts = [
function (context, props) {
const result = {
updatedConfig: null,
updatedActions: [],
updatedFeedbacks: [],
}
for (let action of props.actions) {
if (action.actionId == 'autoLoad') {
if (action.options.autoId == 1) {
action.actionId = 'autoload'
result.updatedActions.push(action)
}
}
if ('flagged' == action.actionId && action.options.flaggId) {
action.options.flagId = action.options.flaggId
delete action.options.flaggId
result.updatedActions.push(action)
}
}
if (props.config) {
if (props.config.useTenths == undefined) {
props.config.useTenths = false
result.updatedConfig = props.config
}
}
return result
},
CreateConvertToBooleanFeedbackUpgradeScript({
q_run: true,
min_go: true,
ws_mode: true,
override: true,
}),
function (context, props) {
// users from figure53-qlab (the other version)
const result = {
updatedConfig: null,
updatedActions: [],
updatedFeedbacks: [],
}
for (let action of props.actions) {
if ('flagged' == action.actionId && action.options.flaggId) {
action.options.flagId = action.options.flaggId
delete action.options.flaggId
result.updatedActions.push(action)
}
}
return result
},
function (context, props) {
// add default port # (QLab5 can configure a different port)
const result = {
updatedConfig: null,
updatedActions: [],
updatedFeedbacks: [],
}
if (props.config) {
if (props.config.port == undefined) {
props.config.port = '53000'
result.updatedConfig = props.config
}
if (props.config.cuelist == undefined) {
props.config.cuelist = 'default'
result.updatedConfig = props.config
}
}
return result
},
]