diff --git a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index 9334699..7647830 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -72,6 +72,20 @@ function details() { \\nExample:\\n veryfast`, }, + { + name: 'sdDisabled', + tooltip: `Input "true" if you want to skip SD (480p and 576p) files + + \\nExample:\\n + true`, + }, + { + name: 'uhdDisabled', + tooltip: `Input "true" if you want to skip 4k (UHD) files + + \\nExample:\\n + true`, + }, ], }; } @@ -97,6 +111,22 @@ function plugin(file, librarySettings, inputs) { } response.infoLog += '☑File is a video! \n'; + // check if the file is SD and sdDisable is enabled + // skip this plugin if so + if (['480p', '576p'].includes(file.video_resolution) && inputs.sdDisabled) { + response.processFile = false; + response.infoLog += '☒File is SD, not processing\n'; + return response; + } + + // check if the file is 4k and 4kDisable is enabled + // skip this plugin if so + if (file.video_resolution === '4KUHD' && inputs.uhdDisabled) { + response.processFile = false; + response.infoLog += '☒File is 4k/UHD, not processing\n'; + return response; + } + // check if the file is already hevc // it will not be transcoded if true and the plugin will be stopped immediately for (let i = 0; i < file.ffProbeData.streams.length; i += 1) {