mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -07:00
Filter resolutions
This commit is contained in:
parent
3b63f8a5b6
commit
cb5e3de895
1 changed files with 35 additions and 0 deletions
35
examples/Tdarr_Plugin_bbbc_Filter_Example.js
Normal file
35
examples/Tdarr_Plugin_bbbc_Filter_Example.js
Normal file
|
|
@ -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;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue