From 8f9a97021f7ef8778258499c37c5ac4bc09d1cd1 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 13:55:02 +0100 Subject: [PATCH] Add Tdarr_Plugin_00td_action_add_audio_stream_codec test --- ...ugin_00td_action_add_audio_stream_codec.js | 1 - ...ugin_00td_action_add_audio_stream_codec.js | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js diff --git a/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js index ef204c1..79b766b 100644 --- a/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js +++ b/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_add_audio_stream_codec', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js new file mode 100644 index 0000000..3862352 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js @@ -0,0 +1,92 @@ +/* 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:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 2 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + 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:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 2 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + channels: 6, + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 6 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + channels: 8, + language: 'fr', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count (8) is higher than the highest channel available in specified lang tag (6). Adding lower channel track. \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, +]; + +run(tests);