mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -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: {
|
||||
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: [
|
||||
|
|
@ -123,8 +126,9 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
|||
let outputNumber = 1;
|
||||
|
||||
if (condition === '==') {
|
||||
if (targetValue === value) {
|
||||
args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${value}`);
|
||||
const valuesArr = value.trim().split(',');
|
||||
if (valuesArr.includes(targetValue)) {
|
||||
args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${valuesArr}`);
|
||||
outputNumber = 1;
|
||||
} else {
|
||||
args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${value}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue