From 44c0d0968310cf92e3dc33975077a673f4de5f80 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:26:34 +0100 Subject: [PATCH] Add Tdarr_Plugin_MC93_Migz3CleanAudio test --- .../Tdarr_Plugin_MC93_Migz3CleanAudio.js | 1 - .../Tdarr_Plugin_MC93_Migz3CleanAudio.js | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js diff --git a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js index 6852f9d..32bf0d2 100644 --- a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz3CleanAudio', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js new file mode 100644 index 0000000..11bd864 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -0,0 +1,98 @@ +/* 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: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain audio tracks which are unwanted or that require tagging.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + language: 'eng', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[3].tags.title = 'description'; + return file; + })(), + librarySettings: {}, + inputs: { + language: 'eng', + commentary: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:2 -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:2 detected as being descriptive, removing. \n' + + '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[2].tags.title = 'description'; + file.ffProbeData.streams[3].tags.language = 'und'; + return file; + })(), + librarySettings: {}, + inputs: { + language: 'eng', + commentary: 'true', + tag_language: 'eng', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:1 -map -0:a:2 -metadata:s:a:2 language=eng -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:1 detected as being descriptive, removing. \n' + + '☒Audio stream 0:a:2 has unwanted language tag und, removing. \n' + + '☒Audio stream 0:a:2 detected as having no language, tagging as eng. \n' + + '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, +]; + +run(tests);