Merge branch 'tags_fix' of https://github.com/HaveAGitGat/Tdarr_Plugins into tags_fix

make-only-subtitle-default
HaveAGitGat 2 years ago
commit 4e507b253c

@ -91,22 +91,26 @@ var plugin = function (args) {
args.jobLog("Required Tags: ".concat(requiredTags.join(','))); args.jobLog("Required Tags: ".concat(requiredTags.join(',')));
args.jobLog("Current Tags: ".concat(currentTags.join(','))); args.jobLog("Current Tags: ".concat(currentTags.join(',')));
var isSubset = true; var isSubset = true;
for (var i = 0; i < currentTags.length; i += 1) { for (var 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: ".concat(currentTags));
args.jobLog("Required tags: ".concat(requiredTags));
args.jobLog("Is Subset: ".concat(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 ".concat(args.variables.queueTags));
+ " requeueing with tags ".concat(args.variables.queueTags));
} }
return { return {
outputFileObj: args.inputFileObj, outputFileObj: args.inputFileObj,

Loading…
Cancel
Save