mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-16 18:45:53 -07:00
Check against multiple values for ==
This commit is contained in:
parent
6a2aa7936d
commit
e5dc35064f
1 changed files with 7 additions and 3 deletions
|
|
@ -64,7 +64,10 @@ const details = (): IpluginDetails => ({
|
||||||
inputUI: {
|
inputUI: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
},
|
},
|
||||||
tooltip: 'Value of variable to check',
|
tooltip: `Value of variable to check.
|
||||||
|
For == condition, you can specify multiple values separated by comma. For example: value1,value2,value3
|
||||||
|
If the variable matches any of the values, the condition is true.
|
||||||
|
`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
outputs: [
|
outputs: [
|
||||||
|
|
@ -123,8 +126,9 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||||
let outputNumber = 1;
|
let outputNumber = 1;
|
||||||
|
|
||||||
if (condition === '==') {
|
if (condition === '==') {
|
||||||
if (targetValue === value) {
|
const valuesArr = value.trim().split(',');
|
||||||
args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${value}`);
|
if (valuesArr.includes(targetValue)) {
|
||||||
|
args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${valuesArr}`);
|
||||||
outputNumber = 1;
|
outputNumber = 1;
|
||||||
} else {
|
} else {
|
||||||
args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${value}`);
|
args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${value}`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue