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; +};