mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -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: [
|
||||
{
|
||||
label: 'CLI',
|
||||
name: 'cli',
|
||||
name: 'userCli',
|
||||
type: 'string',
|
||||
defaultValue: 'mkvmerge',
|
||||
inputUI: {
|
||||
|
|
@ -140,7 +140,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
let selectedCli = String(args.inputs.cli);
|
||||
let userCli = String(args.inputs.userCli);
|
||||
const {
|
||||
outputFileBecomesWorkingFile,
|
||||
} = args.inputs;
|
||||
|
|
@ -175,16 +175,16 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
mkvmerge: 'mkvmerge',
|
||||
};
|
||||
|
||||
if (!availableCli[selectedCli]) {
|
||||
const msg = `CLI ${selectedCli} not available to run in this plugin`;
|
||||
if (!availableCli[userCli]) {
|
||||
const msg = `CLI ${userCli} not available to run in this plugin`;
|
||||
args.jobLog(msg);
|
||||
throw new Error(msg);
|
||||
}
|
||||
|
||||
selectedCli = availableCli[selectedCli];
|
||||
userCli = availableCli[userCli];
|
||||
|
||||
const cli = new CLI({
|
||||
cli: selectedCli,
|
||||
cli: userCli,
|
||||
spawnArgs: cliArgs,
|
||||
spawnOpts: {},
|
||||
jobLog: args.jobLog,
|
||||
|
|
@ -197,7 +197,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
const res = await cli.runCli();
|
||||
|
||||
if (res.cliExitCode !== 0) {
|
||||
const msg = `Running ${selectedCli} failed`;
|
||||
const msg = `Running ${userCli} failed`;
|
||||
args.jobLog(msg);
|
||||
throw new Error(msg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue