From cb5e3de8955ff081a3f8427d322c4aa1fdb8b68b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Wed, 20 Oct 2021 01:49:21 +0100 Subject: [PATCH 1/2] Filter resolutions --- examples/Tdarr_Plugin_bbbc_Filter_Example.js | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/Tdarr_Plugin_bbbc_Filter_Example.js diff --git a/examples/Tdarr_Plugin_bbbc_Filter_Example.js b/examples/Tdarr_Plugin_bbbc_Filter_Example.js new file mode 100644 index 0000000..20a4128 --- /dev/null +++ b/examples/Tdarr_Plugin_bbbc_Filter_Example.js @@ -0,0 +1,35 @@ +module.exports.details = function details() { + return { + id: 'Tdarr_Plugin_bbbc_Filter_Example', + Stage: 'Pre-processing', + Name: 'Filter resolutions', + Type: 'Video', + Operation: 'Filter', + Description: 'This plugin prevents processing files with specified resolutions \n\n', + Version: '1.00', + Link: '', + Tags: '', + }; +}; + +module.exports.plugin = function plugin(file) { + const response = { + processFile: true, + infoLog: '', + }; + + const resolutionsToSkip = [ + "1080p", + '4KUHD' + ]; + + for (let i = 0; i < resolutionsToSkip.length; i += 1) { + if (file.video_resolution === resolutionsToSkip[i]) { + response.processFile = false; + response.infoLog += `Filter preventing processing. File has resolution ${resolutionsToSkip[i]}`; + break; + } + } + + return response; +}; From c8783e1dc6884649468792168f957eacb424eb4c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Wed, 20 Oct 2021 01:49:52 +0100 Subject: [PATCH 2/2] move folder --- examples/{ => filters}/Tdarr_Plugin_bbbc_Filter_Example.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{ => filters}/Tdarr_Plugin_bbbc_Filter_Example.js (100%) diff --git a/examples/Tdarr_Plugin_bbbc_Filter_Example.js b/examples/filters/Tdarr_Plugin_bbbc_Filter_Example.js similarity index 100% rename from examples/Tdarr_Plugin_bbbc_Filter_Example.js rename to examples/filters/Tdarr_Plugin_bbbc_Filter_Example.js