From 46db3be6685b53a1a977028391561ddb34fad6b1 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:51:41 +0100 Subject: [PATCH] Add Tdarr_Plugin_x7ac_Remove_Closed_Captions test --- ...darr_Plugin_x7ac_Remove_Closed_Captions.js | 1 - ...darr_Plugin_x7ac_Remove_Closed_Captions.js | 67 +++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js diff --git a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js index 26afd05..f5fe57a 100644 --- a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js +++ b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_x7ac_Remove_Closed_Captions', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js new file mode 100644 index 0000000..01df48b --- /dev/null +++ b/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -0,0 +1,67 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ',-map 0 -codec copy -bsf:v "filter_units=remove_types=6"', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑Closed captions have not been detected on this file \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.hasClosedCaptions = true; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -codec copy -bsf:v "filter_units=remove_types=6"', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒This file has closed captions \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].closed_captions = 1; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -codec copy -bsf:v "filter_units=remove_types=6"', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒This file has burnt closed captions \n', + }, + }, +]; + +run(tests);