mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 23:48:15 -07:00
shouldProcess if overallOuputArguments
This commit is contained in:
parent
bd74a0e968
commit
65809d4406
2 changed files with 25 additions and 10 deletions
|
|
@ -74,10 +74,15 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
cliArgs.push('-i');
|
||||
cliArgs.push(args.inputFileObj._id);
|
||||
|
||||
let { shouldProcess, streams } = args.variables.ffmpegCommand;
|
||||
|
||||
if (args.variables.ffmpegCommand.overallInputArguments.length > 0) {
|
||||
shouldProcess = true;
|
||||
}
|
||||
|
||||
const inputArgs: string[] = [
|
||||
...args.variables.ffmpegCommand.overallInputArguments,
|
||||
];
|
||||
let { shouldProcess, streams } = args.variables.ffmpegCommand;
|
||||
|
||||
streams = streams.filter((stream) => {
|
||||
if (stream.removed) {
|
||||
|
|
@ -114,6 +119,14 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
inputArgs.push(...stream.inputArgs);
|
||||
}
|
||||
|
||||
const idx = cliArgs.indexOf('-i');
|
||||
cliArgs.splice(idx, 0, ...inputArgs);
|
||||
|
||||
if (args.variables.ffmpegCommand.overallOuputArguments.length > 0) {
|
||||
cliArgs.push(...args.variables.ffmpegCommand.overallOuputArguments);
|
||||
shouldProcess = true;
|
||||
}
|
||||
|
||||
if (!shouldProcess) {
|
||||
args.jobLog('No need to process file, already as required');
|
||||
return {
|
||||
|
|
@ -123,10 +136,6 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
};
|
||||
}
|
||||
|
||||
const idx = cliArgs.indexOf('-i');
|
||||
cliArgs.splice(idx, 0, ...inputArgs);
|
||||
cliArgs.push(...args.variables.ffmpegCommand.overallOuputArguments);
|
||||
|
||||
const outputFilePath = `${getPluginWorkDir(args)}/${getFileName(args.inputFileObj._id)}`
|
||||
+ `.${args.variables.ffmpegCommand.container}`;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue