From 1b36e0a7ddc6b4dcd9dd45b6a156bdd704910935 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:25:20 +0100 Subject: [PATCH] Add Tdarr_Plugin_lmg1_Reorder_Streams test --- .../Tdarr_Plugin_lmg1_Reorder_Streams.js | 1 - .../Tdarr_Plugin_lmg1_Reorder_Streams.js | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js diff --git a/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js index 24de43c..bf5c9a5 100644 --- a/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js +++ b/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_lmg1_Reorder_Streams", diff --git a/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js new file mode 100644 index 0000000..197cc39 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js @@ -0,0 +1,50 @@ +/* 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 has video in first stream\n File meets conditions!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + + const audio = file.ffProbeData.streams[1]; + // eslint-disable-next-line prefer-destructuring + file.ffProbeData.streams[1] = file.ffProbeData.streams[0]; + file.ffProbeData.streams[0] = audio; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v? -map 0:a? -map 0:s? -map 0:d? -map 0:t? -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Video is not in the first stream', + }, + }, +]; + +run(tests);