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