mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-17 03:06:27 -07:00
Update var to userCli
This commit is contained in:
parent
bef48d5c97
commit
d060e0cbcc
1 changed files with 7 additions and 7 deletions
|
|
@ -22,7 +22,7 @@ const details = (): IpluginDetails => ({
|
||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
label: 'CLI',
|
label: 'CLI',
|
||||||
name: 'cli',
|
name: 'userCli',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
defaultValue: 'mkvmerge',
|
defaultValue: 'mkvmerge',
|
||||||
inputUI: {
|
inputUI: {
|
||||||
|
|
@ -140,7 +140,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
|
|
||||||
let selectedCli = String(args.inputs.cli);
|
let userCli = String(args.inputs.userCli);
|
||||||
const {
|
const {
|
||||||
outputFileBecomesWorkingFile,
|
outputFileBecomesWorkingFile,
|
||||||
} = args.inputs;
|
} = args.inputs;
|
||||||
|
|
@ -175,16 +175,16 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
mkvmerge: 'mkvmerge',
|
mkvmerge: 'mkvmerge',
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!availableCli[selectedCli]) {
|
if (!availableCli[userCli]) {
|
||||||
const msg = `CLI ${selectedCli} not available to run in this plugin`;
|
const msg = `CLI ${userCli} not available to run in this plugin`;
|
||||||
args.jobLog(msg);
|
args.jobLog(msg);
|
||||||
throw new Error(msg);
|
throw new Error(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedCli = availableCli[selectedCli];
|
userCli = availableCli[userCli];
|
||||||
|
|
||||||
const cli = new CLI({
|
const cli = new CLI({
|
||||||
cli: selectedCli,
|
cli: userCli,
|
||||||
spawnArgs: cliArgs,
|
spawnArgs: cliArgs,
|
||||||
spawnOpts: {},
|
spawnOpts: {},
|
||||||
jobLog: args.jobLog,
|
jobLog: args.jobLog,
|
||||||
|
|
@ -197,7 +197,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||||
const res = await cli.runCli();
|
const res = await cli.runCli();
|
||||||
|
|
||||||
if (res.cliExitCode !== 0) {
|
if (res.cliExitCode !== 0) {
|
||||||
const msg = `Running ${selectedCli} failed`;
|
const msg = `Running ${userCli} failed`;
|
||||||
args.jobLog(msg);
|
args.jobLog(msg);
|
||||||
throw new Error(msg);
|
throw new Error(msg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue