mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -07:00
Add ffmpegCommand.init to ensure "Begin" command has been used
This commit is contained in:
parent
a8b0fd3c60
commit
0ba6ceb182
4 changed files with 19 additions and 0 deletions
|
|
@ -180,6 +180,9 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
|
||||
args.logOutcome('tSuc');
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
args.variables.ffmpegCommand.init = false;
|
||||
|
||||
return {
|
||||
outputFileObj: {
|
||||
_id: outputFilePath,
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
const container = getContainer(args.inputFileObj._id);
|
||||
|
||||
const ffmpegCommand = {
|
||||
init: true,
|
||||
inputFiles: [],
|
||||
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map((stream:Istreams) => ({
|
||||
...stream,
|
||||
|
|
|
|||
14
FlowPluginsTs/FlowHelpers/1.0.0/interfaces/flowUtils.ts
Normal file
14
FlowPluginsTs/FlowHelpers/1.0.0/interfaces/flowUtils.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { IpluginInputArgs } from './interfaces';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const checkFfmpegCommandInit = (args: IpluginInputArgs): void => {
|
||||
if (!args?.variables?.ffmpegCommand?.init) {
|
||||
throw new Error(
|
||||
'FFmpeg command plugins not used correctly.'
|
||||
+ ' Please use the "Begin Command" plugin before using this plugin.'
|
||||
+ ' Afterwards, use the "Execute" plugin to execute the built FFmpeg command.'
|
||||
+ ' Once the "Execute" plugin has been used, you need to use a new "Begin Command"'
|
||||
+ ' plugin to start a new FFmpeg command.',
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
@ -87,6 +87,7 @@ export interface IffmpegCommandStream extends Istreams {
|
|||
}
|
||||
|
||||
export interface IffmpegCommand {
|
||||
init: boolean,
|
||||
inputFiles: string[],
|
||||
streams: IffmpegCommandStream[]
|
||||
container: string,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue