From a3e63ed696bd22c2827d16479d1a9c51cbc08ad1 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:56:12 +0100 Subject: [PATCH] Add Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium test --- ..._Plugin_VP92_VP9_Match_Bitrate_One_Pass.js | 3 - ...b_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 1 - ...b_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 111 ++++++++++++++++++ 3 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js diff --git a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js index a364d81..1412281 100644 --- a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js +++ b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -255,7 +255,6 @@ class Configurator { function loopOverStreamsOfType(file, type, method) { let id = 0; for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { - console.log(file.ffProbeData.streams[i].codec_type); if (file.ffProbeData.streams[i].codec_type.toLowerCase() === type) { method(file.ffProbeData.streams[i], id); id += 1; @@ -329,7 +328,6 @@ function buildAudioConfiguration(inputs, file, logger) { if ('tags' in stream) { // Remove unwanted languages if ('language' in stream.tags) { - console.log(stream.tags.language.toLowerCase()); if (languages.indexOf(stream.tags.language.toLowerCase()) === -1) { configuration.AddOutputSetting(`-map -0:a:${id}`); streams_removing += 1; @@ -341,7 +339,6 @@ function buildAudioConfiguration(inputs, file, logger) { } }); - console.log(stream_count, streams_removing); if (stream_count === streams_removing) { logger.AddError( '*** All audio tracks would have been removed, removing all delete entries', diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 716e730..88fc14e 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js new file mode 100644 index 0000000..7f04b00 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -0,0 +1,111 @@ +/* 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: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset medium -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☑File has no/compatible subs \n' + + '☑File meets conditions! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☒File has no aac track \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☒File has incompatible subs \n', + }, + }, +]; + +run(tests);