mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-14 09:45:55 -07:00
Tags subset fix
This commit is contained in:
parent
354b2aeabf
commit
b154da79c8
1 changed files with 9 additions and 5 deletions
|
|
@ -109,22 +109,26 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||||
|
|
||||||
let isSubset = true;
|
let isSubset = true;
|
||||||
|
|
||||||
for (let i = 0; i < currentTags.length; i += 1) {
|
for (let i = 0; i < requiredTags.length; i += 1) {
|
||||||
if (!requiredTags.includes(currentTags[i])) {
|
if (!currentTags.includes(requiredTags[i])) {
|
||||||
isSubset = false;
|
isSubset = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// requiredTags needs to be subset of currentTags
|
||||||
|
args.jobLog(`Current tags: ${currentTags}`);
|
||||||
|
args.jobLog(`Required tags: ${requiredTags}`);
|
||||||
|
args.jobLog(`Is Subset: ${isSubset}`);
|
||||||
|
|
||||||
if (isSubset) {
|
if (isSubset) {
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
args.variables.queueTags = '';
|
args.variables.queueTags = '';
|
||||||
args.jobLog('Worker type and tags are subset of required tags');
|
args.jobLog('Required tags are subset of current tags, continuing to next plugin.');
|
||||||
} else {
|
} else {
|
||||||
|
args.jobLog('Required tags are not subset of current tags, requeueing.');
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
args.variables.queueTags = requiredTags.join(',');
|
args.variables.queueTags = requiredTags.join(',');
|
||||||
args.jobLog('Worker type and tags are not subset of required tags,'
|
args.jobLog(`Requeueing with tags ${args.variables.queueTags}`);
|
||||||
+ ` requeueing with tags ${args.variables.queueTags}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue