mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -07:00
Handle no result from classic plugin
This commit is contained in:
parent
351735d69e
commit
68c129e20f
4 changed files with 19 additions and 2 deletions
|
|
@ -127,7 +127,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
case 4:
|
case 4:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
args.jobLog(JSON.stringify(result, null, 2));
|
args.jobLog(JSON.stringify(result, null, 2));
|
||||||
outputNumber = result.processFile ? 1 : 2;
|
outputNumber = (result === null || result === void 0 ? void 0 : result.processFile) ? 1 : 2;
|
||||||
return [2 /*return*/, {
|
return [2 /*return*/, {
|
||||||
outputFileObj: args.inputFileObj,
|
outputFileObj: args.inputFileObj,
|
||||||
outputNumber: outputNumber,
|
outputNumber: outputNumber,
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,14 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
case 4:
|
case 4:
|
||||||
result = _d.sent();
|
result = _d.sent();
|
||||||
args.jobLog(JSON.stringify(result, null, 2));
|
args.jobLog(JSON.stringify(result, null, 2));
|
||||||
|
if (!result) {
|
||||||
|
args.jobLog('No result from classic plugin. Continuing to next flow plugin.');
|
||||||
|
return [2 /*return*/, {
|
||||||
|
outputFileObj: args.inputFileObj,
|
||||||
|
outputNumber: 1,
|
||||||
|
variables: args.variables,
|
||||||
|
}];
|
||||||
|
}
|
||||||
// --- Backwards compatibility------------
|
// --- Backwards compatibility------------
|
||||||
if (result.handBrakeMode) {
|
if (result.handBrakeMode) {
|
||||||
result.handbrakeMode = result.handBrakeMode;
|
result.handbrakeMode = result.handBrakeMode;
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
|
|
||||||
args.jobLog(JSON.stringify(result, null, 2));
|
args.jobLog(JSON.stringify(result, null, 2));
|
||||||
|
|
||||||
const outputNumber = result.processFile ? 1 : 2;
|
const outputNumber = result?.processFile ? 1 : 2;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
outputFileObj: args.inputFileObj,
|
outputFileObj: args.inputFileObj,
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,15 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
|
|
||||||
args.jobLog(JSON.stringify(result, null, 2));
|
args.jobLog(JSON.stringify(result, null, 2));
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
args.jobLog('No result from classic plugin. Continuing to next flow plugin.');
|
||||||
|
return {
|
||||||
|
outputFileObj: args.inputFileObj,
|
||||||
|
outputNumber: 1,
|
||||||
|
variables: args.variables,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// --- Backwards compatibility------------
|
// --- Backwards compatibility------------
|
||||||
if (result.handBrakeMode) {
|
if (result.handBrakeMode) {
|
||||||
result.handbrakeMode = result.handBrakeMode;
|
result.handbrakeMode = result.handBrakeMode;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue