mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-17 11:16:26 -07:00
Install deps if possible
This commit is contained in:
parent
07f0cf7c3f
commit
4a532f6f25
5 changed files with 56 additions and 3 deletions
|
|
@ -110,6 +110,21 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
+ 'Operation: Filter. This classic plugin has Operation: ').concat(classicPlugin.details().Operation)
|
+ 'Operation: Filter. This classic plugin has Operation: ').concat(classicPlugin.details().Operation)
|
||||||
+ 'Please use the Run Classic Transcode Flow Plugin plugin instead.');
|
+ 'Please use the Run Classic Transcode Flow Plugin plugin instead.');
|
||||||
}
|
}
|
||||||
|
if (!Array.isArray(classicPlugin.dependencies)) return [3 /*break*/, 7];
|
||||||
|
if (!args.installClassicPluginDeps) return [3 /*break*/, 5];
|
||||||
|
args.jobLog("Installing dependencies for ".concat(pluginSourceId));
|
||||||
|
return [4 /*yield*/, args.installClassicPluginDeps(classicPlugin.dependencies)];
|
||||||
|
case 4:
|
||||||
|
_a.sent();
|
||||||
|
return [3 /*break*/, 6];
|
||||||
|
case 5:
|
||||||
|
args.jobLog("Not installing dependencies for ".concat(pluginSourceId, ", please update Tdarr"));
|
||||||
|
_a.label = 6;
|
||||||
|
case 6: return [3 /*break*/, 8];
|
||||||
|
case 7:
|
||||||
|
args.jobLog("No depedencies to install for ".concat(pluginSourceId));
|
||||||
|
_a.label = 8;
|
||||||
|
case 8:
|
||||||
container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
|
container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
|
||||||
cacheFilePath = "".concat((0, fileUtils_1.getPluginWorkDir)(args), "/").concat((0, fileUtils_1.getFileName)(args.inputFileObj._id), ".").concat(container);
|
cacheFilePath = "".concat((0, fileUtils_1.getPluginWorkDir)(args), "/").concat((0, fileUtils_1.getFileName)(args.inputFileObj._id), ".").concat(container);
|
||||||
otherArguments = {
|
otherArguments = {
|
||||||
|
|
@ -126,7 +141,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
job: args.job,
|
job: args.job,
|
||||||
};
|
};
|
||||||
return [4 /*yield*/, classicPlugin.plugin(args.inputFileObj, args.librarySettings, args.inputs, otherArguments)];
|
return [4 /*yield*/, classicPlugin.plugin(args.inputFileObj, args.librarySettings, args.inputs, otherArguments)];
|
||||||
case 4:
|
case 9:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
args.jobLog(JSON.stringify(result, null, 2));
|
args.jobLog(JSON.stringify(result, null, 2));
|
||||||
outputNumber = (result === null || result === void 0 ? void 0 : result.processFile) ? 1 : 2;
|
outputNumber = (result === null || result === void 0 ? void 0 : result.processFile) ? 1 : 2;
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,21 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
+ 'Operation: Transcode. This classic plugin has Operation: ').concat(classicPlugin.details().Operation)
|
+ 'Operation: Transcode. This classic plugin has Operation: ').concat(classicPlugin.details().Operation)
|
||||||
+ 'Please use the Run Classic Filter Flow Plugin plugin instead.');
|
+ 'Please use the Run Classic Filter Flow Plugin plugin instead.');
|
||||||
}
|
}
|
||||||
|
if (!Array.isArray(classicPlugin.dependencies)) return [3 /*break*/, 7];
|
||||||
|
if (!args.installClassicPluginDeps) return [3 /*break*/, 5];
|
||||||
|
args.jobLog("Installing dependencies for ".concat(pluginSourceId));
|
||||||
|
return [4 /*yield*/, args.installClassicPluginDeps(classicPlugin.dependencies)];
|
||||||
|
case 4:
|
||||||
|
_d.sent();
|
||||||
|
return [3 /*break*/, 6];
|
||||||
|
case 5:
|
||||||
|
args.jobLog("Not installing dependencies for ".concat(pluginSourceId, ", please update Tdarr"));
|
||||||
|
_d.label = 6;
|
||||||
|
case 6: return [3 /*break*/, 8];
|
||||||
|
case 7:
|
||||||
|
args.jobLog("No depedencies to install for ".concat(pluginSourceId));
|
||||||
|
_d.label = 8;
|
||||||
|
case 8:
|
||||||
container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
|
container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
|
||||||
cacheFilePath = "".concat((0, fileUtils_1.getPluginWorkDir)(args), "/").concat((0, fileUtils_1.getFileName)(args.inputFileObj._id), ".").concat(container);
|
cacheFilePath = "".concat((0, fileUtils_1.getPluginWorkDir)(args), "/").concat((0, fileUtils_1.getFileName)(args.inputFileObj._id), ".").concat(container);
|
||||||
otherArguments = {
|
otherArguments = {
|
||||||
|
|
@ -138,7 +153,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
job: args.job,
|
job: args.job,
|
||||||
};
|
};
|
||||||
return [4 /*yield*/, classicPlugin.plugin(args.inputFileObj, args.librarySettings, args.inputs, otherArguments)];
|
return [4 /*yield*/, classicPlugin.plugin(args.inputFileObj, args.librarySettings, args.inputs, otherArguments)];
|
||||||
case 4:
|
case 9:
|
||||||
result = _d.sent();
|
result = _d.sent();
|
||||||
args.jobLog(JSON.stringify(result, null, 2));
|
args.jobLog(JSON.stringify(result, null, 2));
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|
@ -252,7 +267,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
|
||||||
updateWorker: args.updateWorker,
|
updateWorker: args.updateWorker,
|
||||||
});
|
});
|
||||||
return [4 /*yield*/, cli.runCli()];
|
return [4 /*yield*/, cli.runCli()];
|
||||||
case 5:
|
case 10:
|
||||||
res = _d.sent();
|
res = _d.sent();
|
||||||
if (res.cliExitCode !== 0) {
|
if (res.cliExitCode !== 0) {
|
||||||
args.jobLog("Running ".concat(cliPath, " failed"));
|
args.jobLog("Running ".concat(cliPath, " failed"));
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,17 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(classicPlugin.dependencies)) {
|
||||||
|
if (args.installClassicPluginDeps) {
|
||||||
|
args.jobLog(`Installing dependencies for ${pluginSourceId}`);
|
||||||
|
await args.installClassicPluginDeps(classicPlugin.dependencies);
|
||||||
|
} else {
|
||||||
|
args.jobLog(`Not installing dependencies for ${pluginSourceId}, please update Tdarr`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
args.jobLog(`No depedencies to install for ${pluginSourceId}`);
|
||||||
|
}
|
||||||
|
|
||||||
const container = getContainer(args.inputFileObj._id);
|
const container = getContainer(args.inputFileObj._id);
|
||||||
const cacheFilePath = `${getPluginWorkDir(args)}/${getFileName(args.inputFileObj._id)}.${container}`;
|
const cacheFilePath = `${getPluginWorkDir(args)}/${getFileName(args.inputFileObj._id)}.${container}`;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,17 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(classicPlugin.dependencies)) {
|
||||||
|
if (args.installClassicPluginDeps) {
|
||||||
|
args.jobLog(`Installing dependencies for ${pluginSourceId}`);
|
||||||
|
await args.installClassicPluginDeps(classicPlugin.dependencies);
|
||||||
|
} else {
|
||||||
|
args.jobLog(`Not installing dependencies for ${pluginSourceId}, please update Tdarr`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
args.jobLog(`No depedencies to install for ${pluginSourceId}`);
|
||||||
|
}
|
||||||
|
|
||||||
const container = getContainer(args.inputFileObj._id);
|
const container = getContainer(args.inputFileObj._id);
|
||||||
let cacheFilePath = `${getPluginWorkDir(args)}/${getFileName(args.inputFileObj._id)}.${container}`;
|
let cacheFilePath = `${getPluginWorkDir(args)}/${getFileName(args.inputFileObj._id)}.${container}`;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ export interface IpluginInputArgs {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
axios: any,
|
axios: any,
|
||||||
},
|
},
|
||||||
|
installClassicPluginDeps: (deps: string[]) => void,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IflowTemplate {
|
export interface IflowTemplate {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue