mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-17 03:06:27 -07:00
Add error variable
This commit is contained in:
parent
3ab3707703
commit
b1975b8d65
3 changed files with 7 additions and 0 deletions
|
|
@ -15,6 +15,9 @@ const details = (): IpluginDetails => ({
|
||||||
that output a file.
|
that output a file.
|
||||||
|
|
||||||
Can be placed anywhere before a plugin which outputs a new file.
|
Can be placed anywhere before a plugin which outputs a new file.
|
||||||
|
|
||||||
|
You can check if this plugin caused an error by using 'Check Flow Variable' and checking if
|
||||||
|
{{{args.variables.liveSizeCompare.error}}} is true.
|
||||||
',
|
',
|
||||||
`,
|
`,
|
||||||
style: {
|
style: {
|
||||||
|
|
@ -155,6 +158,7 @@ const plugin = (args: IpluginInputArgs):IpluginOutputArgs => {
|
||||||
compareMethod,
|
compareMethod,
|
||||||
thresholdPerc,
|
thresholdPerc,
|
||||||
checkDelaySeconds,
|
checkDelaySeconds,
|
||||||
|
error: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,8 @@ class CLI {
|
||||||
|
|
||||||
this.config.jobLog(`Ratio is greater than threshold: ${thresholdPerc}%, cancelling job`);
|
this.config.jobLog(`Ratio is greater than threshold: ${thresholdPerc}%, cancelling job`);
|
||||||
this.cancelled = true;
|
this.cancelled = true;
|
||||||
|
// @ts-expect-error must exist to be here
|
||||||
|
this.config.args.variables.liveSizeCompare.error = true;
|
||||||
this.killThread();
|
this.killThread();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ export interface IliveSizeCompare {
|
||||||
compareMethod: string,
|
compareMethod: string,
|
||||||
thresholdPerc: number,
|
thresholdPerc: number,
|
||||||
checkDelaySeconds: number,
|
checkDelaySeconds: number,
|
||||||
|
error: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Ivariables {
|
export interface Ivariables {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue