HaveAGitGat / Tdarr

Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)
Other
2.91k stars 90 forks source link

Plugin Causing Screen Blanking #811

Closed nichols89ben closed 1 year ago

nichols89ben commented 1 year ago

Haven't been able to figure this one out. When I add this custom plugin to the transcode stack, the webpage goes blank and grey. The logs dont show anything with the server going down or nodes. You can go back, but if the plug-in is in the stack, as soon as you go to the transcode tab again, it goes back to grey, so your only option is to delete the library. Still odd if you go to the dedicated plugin page, under local, the plug-in shows just fine; you can read/edit the code and view the user options. Here's the plug-in if anyone sees a mistake I made. Thanks in advance

const details = () => ({ id: 'Custom_Filter', Stage: 'Pre-processing', Name: 'Custom Filter by resolution and bitrate', Type: 'Video', Operation: 'Filter', Description: 'Filter videos by resolution and bitrate based on the selected processing mode (CPU or GPU)', Version: '1.00', Tags: 'filter', Inputs: [ { name: 'processingMode', type: 'string', defaultValue: 'CPU', inputUI: { type: 'dropdown', values: ['CPU', 'GPU'], }, tooltip: 'Select the processing mode. This determines the filter conditions for resolution and bitrate.' }, { name: 'bitrateCutoff', type: 'number', defaultValue: 6000, inputUI: { type: 'text', }, tooltip: 'Enter the bitrate cutoff in Kb for 1080p and 1440p videos. Videos with these resolutions and a bitrate lower/higher than this value will not be processed, depending on the selected processing mode.' }, ], });

// eslint-disable-next-line no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); // eslint-disable-next-line no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, infoLog: '', };

if (!file.video_resolution || !file.bit_rate) { throw new Error('File has no resolution or bitrate!'); }

const fileResolution = file.video_resolution; const fileBitrate = file.bit_rate / 1000; // Convert from bps to Kbps

const highResolutions = ['4KUHD', 'DCI4K', '8KUHD']; const midResolutions = ['1080p', '1440p']; const lowResolutions = ['480p', '576p', '720p'];

if (inputs.processingMode === 'CPU') { if (highResolutions.includes(fileResolution)) { response.processFile = true; response.infoLog += 'File is in highResolutions. Moving to next plugin.'; } else if (midResolutions.includes(fileResolution) && fileBitrate >= inputs.bitrateCutoff) { response.processFile = true; response.infoLog += 'File is in midResolutions and bitrate is above cutoff. Moving to next plugin.'; } else { response.processFile = false; response.infoLog += 'File does not meet CPU processing criteria. Breaking out of plugin stack.'; } } else if (inputs.processingMode === 'GPU') { if (lowResolutions.includes(fileResolution)) { response.processFile = true; response.infoLog += 'File is in lowResolutions. Moving to next plugin.'; } else if (midResolutions.includes(fileResolution) && fileBitrate < inputs.bitrateCutoff) { response.processFile = true; response.infoLog += 'File is in midResolutions and bitrate is below cutoff. Moving to next plugin.'; } else { response.processFile = false; response.infoLog += 'File does not meet GPU processing criteria. Breaking out of plugin stack.'; } }

return response; };

module.exports.details = details; module.exports.plugin = plugin;


Ubuntu Firefox 2.00.21

HaveAGitGat commented 1 year ago

Hi, this is due to small typo:

values: ['CPU', 'GPU'],

should be

options: ['CPU', 'GPU'],

Reopen if needed thanks