Fix checkPlugins issues

make-only-subtitle-default
HaveAGitGat 2 years ago
parent cbbae8e67a
commit 36b3223957

@ -1,56 +0,0 @@
/* eslint-disable */
const details = () => ({
id: 'Tdarr_Plugin_075a_FFMPEG_HEVC_Generic',
Stage: 'Pre-processing',
Name: 'FFMPEG H265',
Type: 'Video',
Operation: 'Transcode',
Description: '[Contains built-in filter] This plugin transcodes non h265 files into h265 mkv using default settings. Audio/subtitles not affected. \n\n',
Version: '1.00',
Tags: 'pre-processing,ffmpeg,h265,video only',
Inputs: [],
});
// 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);
// Must return this object
const response = {
processFile: false,
preset: '',
container: '.mp4',
handBrakeMode: false,
FFmpegMode: false,
reQueueAfter: false,
infoLog: '',
};
if (file.fileMedium !== 'video') {
response.processFile = false;
response.infoLog += '☒File is not a video! \n';
return response;
}
response.infoLog += '☑File is a video! \n';
if (file.ffProbeData.streams[0].codec_name == 'hevc') {
response.processFile = false;
response.infoLog += '☑File is already in hevc! \n';
return response;
}
response.processFile = true;
response.preset = ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:v:0 libx265 -max_muxing_queue_size 9999';
response.container = '.mkv';
response.handBrakeMode = false;
response.FFmpegMode = true;
response.reQueueAfter = true;
response.infoLog += '☒File is not hevc! \n';
return response;
};
module.exports.details = details;
module.exports.plugin = plugin;

@ -1,14 +1,10 @@
/* eslint-disable max-len */ /* eslint-disable max-len */
const fs = require('fs');
const path = require('path');
const loadDefaultValues = require('../methods/loadDefaultValues');
const details = () => ({ const details = () => ({
id: 'Tdarr_Plugin_rename_based_on_codec_schadi', id: 'Tdarr_Plugin_rename_based_on_codec_schadi',
Stage: 'Post-processing', Stage: 'Post-processing',
Name: 'Rename based on codec Video and Audio', Name: 'Rename based on codec Video and Audio',
Type: 'Video_Audio', Type: 'Video',
Operation: 'Transcode', Operation: 'Transcode',
Description: ` Description: `
If the filename contains a codec information like h264, av1 or similar for video and AC3, AAC or trueHD \n\n If the filename contains a codec information like h264, av1 or similar for video and AC3, AAC or trueHD \n\n
@ -53,7 +49,7 @@ const details = () => ({
}, },
{ {
name: 'additional_extensions', name: 'additional_extensions',
type: 'text', type: 'string',
defaultValue: '.nfo,.srt', defaultValue: '.nfo,.srt',
inputUI: { inputUI: {
type: 'text', type: 'text',
@ -67,8 +63,13 @@ const details = () => ({
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs, otherArguments) => { const plugin = (file, librarySettings, inputs, otherArguments) => {
// eslint-disable-next-line no-param-reassign const lib = require('../methods/lib')();
inputs = loadDefaultValues(inputs, details); // eslint-disable-next-line no-unused-vars,no-param-reassign
inputs = lib.loadDefaultValues(inputs, details);
const fs = require('fs');
const path = require('path');
const fileNameOld = file._id; const fileNameOld = file._id;
const response = { const response = {

Loading…
Cancel
Save