mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -07:00
Merge branch 'tags_fix' of https://github.com/HaveAGitGat/Tdarr_Plugins into tags_fix
This commit is contained in:
commit
4e507b253c
1 changed files with 9 additions and 5 deletions
|
|
@ -91,22 +91,26 @@ var plugin = function (args) {
|
|||
args.jobLog("Required Tags: ".concat(requiredTags.join(',')));
|
||||
args.jobLog("Current Tags: ".concat(currentTags.join(',')));
|
||||
var isSubset = true;
|
||||
for (var i = 0; i < currentTags.length; i += 1) {
|
||||
if (!requiredTags.includes(currentTags[i])) {
|
||||
for (var i = 0; i < requiredTags.length; i += 1) {
|
||||
if (!currentTags.includes(requiredTags[i])) {
|
||||
isSubset = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// requiredTags needs to be subset of currentTags
|
||||
args.jobLog("Current tags: ".concat(currentTags));
|
||||
args.jobLog("Required tags: ".concat(requiredTags));
|
||||
args.jobLog("Is Subset: ".concat(isSubset));
|
||||
if (isSubset) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
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 {
|
||||
args.jobLog('Required tags are not subset of current tags, requeueing.');
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
args.variables.queueTags = requiredTags.join(',');
|
||||
args.jobLog('Worker type and tags are not subset of required tags,'
|
||||
+ " requeueing with tags ".concat(args.variables.queueTags));
|
||||
args.jobLog("Requeueing with tags ".concat(args.variables.queueTags));
|
||||
}
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue