From d409773061f74e79c3c8e51e38f098dad6a02a14 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 14:14:43 +0100 Subject: [PATCH] Add Tdarr_Plugin_00td_action_keep_one_audio_stream test --- ...lugin_00td_action_keep_one_audio_stream.js | 1 - ...lugin_00td_action_keep_one_audio_stream.js | 89 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js diff --git a/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js index 789fbae..5925da3 100644 --- a/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js +++ b/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_keep_one_audio_stream', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js new file mode 100644 index 0000000..26d68f4 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js @@ -0,0 +1,89 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 aac -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No en streams. The required channel count 2 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No en streams. The required channel count 2 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + language: 'fr', + channels: '6', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No fr streams. The required channel count 6 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'aac', + language: 'und', + channels: '8', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'The best und stream already exists. It is the only audio stream. \n', + handbrakeMode: false, + }, + }, +]; + +run(tests);