From 80563106dd32ffb6f878a05b0f5f7ccd4519f288 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Wed, 22 May 2024 09:10:10 +0100 Subject: [PATCH 1/2] Flow Run Health Check updates stats and queues --- .../video/runHealthCheck/1.0.0/index.ts | 11 +++++++++++ .../FlowHelpers/1.0.0/interfaces/interfaces.ts | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.ts index 550062b..c1d3244 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.ts @@ -97,11 +97,22 @@ const plugin = async (args:IpluginInputArgs):Promise => { const res = await cli.runCli(); + // Added in 2.19.01 + if (typeof args.updateStat !== 'undefined') { + await args.updateStat(args.originalLibraryFile.DB, 'totalHealthCheckCount', 1); + } + if (res.cliExitCode !== 0) { args.jobLog('Running CLI failed'); + args.logOutcome('hErr'); throw new Error('Running CLI failed'); } + args.logOutcome('hSuc'); + + // will cause item to go into the health check success table + args.variables.healthCheck = 'Success'; + return { outputFileObj: args.inputFileObj, outputNumber: 1, diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts b/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts index 77ada1f..f85e80c 100644 --- a/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts +++ b/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts @@ -100,6 +100,7 @@ export interface Ivariables { ffmpegCommand: IffmpegCommand, flowFailed: boolean, user: Record, + healthCheck?: 'Success', } export interface IpluginOutputArgs { @@ -137,7 +138,8 @@ export interface IpluginInputArgs { updateWorker: IupdateWorker, logFullCliOutput: boolean, logOutcome: (outcome: string) => void, - scanIndividualFile?: (filee: IFileObjectMin, scanTypes: IscanTypes) => IFileObject, + scanIndividualFile?: (filee: IFileObjectMin, scanTypes: IscanTypes) => Promise, + updateStat: (db: string, key: string, inc: number) => Promise, deps: { // eslint-disable-next-line @typescript-eslint/no-explicit-any fsextra: any, From 03367b0d421c890784e81192f33836bba2d3e3fd Mon Sep 17 00:00:00 2001 From: HaveAGitGat Date: Wed, 22 May 2024 08:12:01 +0000 Subject: [PATCH 2/2] Apply auto-build changes --- .../video/runHealthCheck/1.0.0/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/FlowPlugins/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.js index 9075aae..f5c38ee 100644 --- a/FlowPlugins/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/video/runHealthCheck/1.0.0/index.js @@ -126,10 +126,20 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function return [4 /*yield*/, cli.runCli()]; case 1: res = _a.sent(); + if (!(typeof args.updateStat !== 'undefined')) return [3 /*break*/, 3]; + return [4 /*yield*/, args.updateStat(args.originalLibraryFile.DB, 'totalHealthCheckCount', 1)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: if (res.cliExitCode !== 0) { args.jobLog('Running CLI failed'); + args.logOutcome('hErr'); throw new Error('Running CLI failed'); } + args.logOutcome('hSuc'); + // will cause item to go into the health check success table + args.variables.healthCheck = 'Success'; return [2 /*return*/, { outputFileObj: args.inputFileObj, outputNumber: 1,