Apply auto-build changes

make-only-subtitle-default
HaveAGitGat 2 years ago committed by github-actions[bot]
parent ef0aef8c0e
commit 19b27167c1

@ -0,0 +1,115 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
var details = function () { return ({
name: 'Tags: Requeue',
description: "\nPlace the file back in the staging queue with specific tags.\n\nOnly Nodes/Workers which match the tags will be able to process the file.\n\nThe tags must have one of the following: 'requireCPU', 'requireGPU', or 'requireCPUorGPU'.\n\nThe above tells the server what type of worker is required to process the file.\n\nSubsequent tags must not use the reserved word 'require' in them.\n\nYou can set the 'Node Tags' in the Node options panel.\n\nThe the item tags in the staging section must be a subset of the required tags for a worker to process the file.\n",
style: {
borderColor: 'yellow',
},
tags: '',
isStartPlugin: false,
pType: '',
requiresVersion: '2.20.01',
sidebarPosition: -1,
icon: 'faRedo',
inputs: [
{
label: 'Use Basic Queue Tags',
name: 'useBasicQueueTags',
type: 'boolean',
defaultValue: 'true',
inputUI: {
type: 'switch',
},
tooltip: 'Use basic queue tags or custom tags.',
},
{
label: 'Basic Queue Tags',
name: 'basicQueueTags',
type: 'string',
defaultValue: 'requireCPU',
inputUI: {
type: 'dropdown',
displayConditions: {
logic: 'AND',
sets: [
{
logic: 'AND',
inputs: [
{
name: 'useBasicQueueTags',
value: 'true',
condition: '===',
},
],
},
],
},
options: [
'requireCPU',
'requireGPU',
'requireGPU:nvenc',
'requireGPU:qsv',
'requireGPU:vaapi',
'requireGPU:videotoolbox',
'requireGPU:amf',
'requireCPUorGPU',
],
},
tooltip: 'Specify tags to requeue file with.',
},
{
label: 'Custom Queue Tags',
name: 'customQueueTags',
type: 'string',
defaultValue: 'requireCPUorGPU,tag1',
inputUI: {
type: 'textarea',
style: {
height: '100px',
},
displayConditions: {
logic: 'AND',
sets: [
{
logic: 'AND',
inputs: [
{
name: 'useBasicQueueTags',
value: 'true',
condition: '!==',
},
],
},
],
},
},
tooltip: "\nrequireGPU:nvenc,tag1,tag2\nrequireCPUorGPU,tag1,tag2\nrequireCPU,tag1,tag2\nrequireGPU,tag1,tag2,tag3\nrequireGPU,tag1\nrequireGPU,{{{args.userVariables.global.test}}}\nrequireCPUorGPU,tag1,tag2\n ",
},
],
outputs: [
{
number: 1,
tooltip: 'Continue to next plugin',
},
],
}); };
exports.details = details;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
var plugin = function (args) {
var lib = require('../../../../../methods/lib')();
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
args.inputs = lib.loadDefaultValues(args.inputs, details);
var basicQueueTags = String(args.inputs.basicQueueTags);
var customQueueTags = String(args.inputs.customQueueTags);
// eslint-disable-next-line no-param-reassign
args.variables.queueTags = args.inputs.useBasicQueueTags ? basicQueueTags : customQueueTags;
return {
outputFileObj: args.inputFileObj,
outputNumber: 1,
variables: args.variables,
};
};
exports.plugin = plugin;

@ -0,0 +1,117 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
var details = function () { return ({
name: 'Tags: Worker Type',
description: "\nRequeues the item into the staging section if the current worker\ndoes not match the required worker type and tags.\n\nYou can set the 'Node Tags' in the Node options panel.\n\nThe current tags must be a subset of the required tags.\n ",
style: {
borderColor: 'yellow',
},
tags: '',
isStartPlugin: false,
pType: '',
requiresVersion: '2.20.01',
sidebarPosition: -1,
icon: 'faFilter',
inputs: [
{
label: 'Required Transcode Worker Type',
name: 'requiredWorkerType',
type: 'string',
defaultValue: 'CPUorGPU',
inputUI: {
type: 'dropdown',
options: [
'CPUorGPU',
'CPU',
'GPU',
'GPU:nvenc',
'GPU:qsv',
'GPU:vaapi',
'GPU:videotoolbox',
'GPU:amf',
],
},
tooltip: 'Specify worker type',
},
{
label: 'Required Node Tags',
name: 'requiredNodeTags',
type: 'string',
defaultValue: '',
inputUI: {
type: 'textarea',
style: {
height: '100px',
},
},
tooltip: "\ntag1,tag2\n ",
},
],
outputs: [
{
number: 1,
tooltip: 'Continue to next plugin',
},
],
}); };
exports.details = details;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
var plugin = function (args) {
var lib = require('../../../../../methods/lib')();
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
args.inputs = lib.loadDefaultValues(args.inputs, details);
var requiredWorkerType = String(args.inputs.requiredWorkerType);
var requiredNodeTags = String(args.inputs.requiredNodeTags);
var requiredTags = [];
var currentTags = [];
requiredTags.push("require".concat(requiredWorkerType));
if (requiredNodeTags) {
requiredTags = requiredTags.concat(requiredNodeTags.split(',').map(function (tag) { return tag.trim(); }));
}
var currentWorkerType = args.workerType;
if (requiredWorkerType === 'CPUorGPU') {
currentTags.push('requireCPUorGPU');
}
else if (currentWorkerType === 'transcodecpu') {
currentTags.push('requireCPU');
}
else if (currentWorkerType === 'transcodegpu') {
if (args.nodeHardwareType && args.nodeHardwareType !== '-') {
currentTags.push("requireGPU:".concat(args.nodeHardwareType));
}
else {
currentTags.push('requireGPU');
}
}
if (args.nodeTags) {
currentTags = currentTags.concat(args.nodeTags.split(',').map(function (tag) { return tag.trim(); }));
}
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])) {
isSubset = false;
break;
}
}
if (isSubset) {
// eslint-disable-next-line no-param-reassign
args.variables.queueTags = '';
args.jobLog('Worker type and tags are subset of required tags');
}
else {
// 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));
}
return {
outputFileObj: args.inputFileObj,
outputNumber: 1,
variables: args.variables,
};
};
exports.plugin = plugin;
Loading…
Cancel
Save