diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js index 57f046f..c87d265 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -114,12 +114,16 @@ function plugin(file, librarySettings, inputs) { let bitrateSettings = ''; // Work out currentBitrate using "Bitrate = file size / (number of minutes * .0075)" // Used from here https://blog.frame.io/2017/03/06/calculate-video-bitrates/ + // eslint-disable-next-line no-bitwise const currentBitrate = ~~(file.file_size / (duration * 0.0075)); // Use the same calculation used for currentBitrate but divide it in half to get targetBitrate. // Logic of h265 can be half the bitrate as h264 without losing quality. + // eslint-disable-next-line no-bitwise const targetBitrate = ~~(file.file_size / (duration * 0.0075) / 2); // Allow some leeway under and over the targetBitrate. + // eslint-disable-next-line no-bitwise const minimumBitrate = ~~(targetBitrate * 0.7); + // eslint-disable-next-line no-bitwise const maximumBitrate = ~~(targetBitrate * 1.3); // If targetBitrate comes out as 0 then something has gone wrong and bitrates could not be calculated. @@ -250,7 +254,8 @@ function plugin(file, librarySettings, inputs) { } // Set bitrateSettings variable using bitrate information calulcated earlier. - bitrateSettings = `-b:v ${targetBitrate}k -minrate ${minimumBitrate}k -maxrate ${maximumBitrate}k -bufsize ${currentBitrate}k`; + bitrateSettings = `-b:v ${targetBitrate}k -minrate ${minimumBitrate}k ` + + `-maxrate ${maximumBitrate}k -bufsize ${currentBitrate}k`; // Print to infoLog information around file & bitrate settings. response.infoLog += `Container for output selected as ${inputs.container}. \n`; response.infoLog += `Current bitrate = ${currentBitrate} \n`; @@ -278,7 +283,8 @@ function plugin(file, librarySettings, inputs) { response.preset = '-c:v vp8_cuvid'; } - response.preset += `,-map 0 -c:v hevc_nvenc -rc:v vbr_hq -cq:v 19 ${bitrateSettings} -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 ${extraArguments}`; + response.preset += `,-map 0 -c:v hevc_nvenc -rc:v vbr_hq -cq:v 19 ${bitrateSettings} ` + + `-spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 ${extraArguments}`; response.processFile = true; response.infoLog += 'File is not hevc or vp9. Transcoding. \n'; return response; diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js index 52068d8..88b87db 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -101,12 +101,16 @@ function plugin(file, librarySettings, inputs) { let bitrateSettings = ''; // Work out currentBitrate using "Bitrate = file size / (number of minutes * .0075)" // Used from here https://blog.frame.io/2017/03/06/calculate-video-bitrates/ + // eslint-disable-next-line no-bitwise const currentBitrate = ~~(file.file_size / (duration * 0.0075)); // Use the same calculation used for currentBitrate but divide it in half to get targetBitrate. // Logic of h265 can be half the bitrate as h264 without losing quality. + // eslint-disable-next-line no-bitwise const targetBitrate = ~~(file.file_size / (duration * 0.0075) / 2); // Allow some leeway under and over the targetBitrate. + // eslint-disable-next-line no-bitwise const minimumBitrate = ~~(targetBitrate * 0.7); + // eslint-disable-next-line no-bitwise const maximumBitrate = ~~(targetBitrate * 1.3); // If targetBitrate comes out as 0 then something has gone wrong and bitrates could not be calculcated. @@ -124,7 +128,8 @@ function plugin(file, librarySettings, inputs) { // If so then cancel plugin without touching original files. if (currentBitrate <= inputs.bitrate_cutoff) { response.processFile = false; - response.infoLog += `Current bitrate is below set bitrate cutoff of ${inputs.bitrate_cutoff}. Nothing to do, cancelling plugin. \n`; + response.infoLog += 'Current bitrate is below set bitrate cutoff ' + + `of ${inputs.bitrate_cutoff}. Nothing to do, cancelling plugin. \n`; return response; } } @@ -218,7 +223,8 @@ function plugin(file, librarySettings, inputs) { } // Set bitrateSettings variable using bitrate information calulcated earlier. - bitrateSettings = `-b:v ${targetBitrate}k -minrate ${minimumBitrate}k -maxrate ${maximumBitrate}k -bufsize ${currentBitrate}k`; + bitrateSettings = `-b:v ${targetBitrate}k -minrate ${minimumBitrate}k ` + + `-maxrate ${maximumBitrate}k -bufsize ${currentBitrate}k`; // Print to infoLog information around file & bitrate settings. response.infoLog += `Container for output selected as ${inputs.container}. \n`; response.infoLog += `Current bitrate = ${currentBitrate} \n`; @@ -227,7 +233,8 @@ function plugin(file, librarySettings, inputs) { response.infoLog += `Minimum = ${minimumBitrate} \n`; response.infoLog += `Maximum = ${maximumBitrate} \n`; - response.preset += `,-map 0 -c:v libx265 ${bitrateSettings} -c:a copy -c:s copy -max_muxing_queue_size 9999 ${extraArguments}`; + response.preset += `,-map 0 -c:v libx265 ${bitrateSettings} ` + + `-c:a copy -c:s copy -max_muxing_queue_size 9999 ${extraArguments}`; response.processFile = true; response.infoLog += 'File is not hevc or vp9. Transcoding. \n'; return response; diff --git a/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/Community/Tdarr_Plugin_MC93_Migz1Remux.js index 4db43f6..4d2ffa1 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ b/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -125,6 +125,8 @@ function plugin(file, librarySettings, inputs) { response.processFile = true; return response; } + + return response; } module.exports.details = details; module.exports.plugin = plugin; diff --git a/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js b/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js index 2685be9..2992a4b 100644 --- a/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js +++ b/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js @@ -71,6 +71,7 @@ function plugin(file, librarySettings, inputs) { // Check if file is a video. If it isn't then exit plugin. if (file.fileMedium !== 'video') { + // eslint-disable-next-line no-console console.log('File is not video'); response.infoLog += '☒File is not video \n'; response.processFile = false; diff --git a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js index 73a1d9c..e8be8dc 100644 --- a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -73,6 +73,7 @@ function plugin(file, librarySettings, inputs) { // Check if file is a video. If it isn't then exit plugin. if (file.fileMedium !== 'video') { + // eslint-disable-next-line no-console console.log('File is not video'); response.infoLog += '☒File is not video \n'; response.processFile = false; diff --git a/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js b/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js index 32010d9..9353278 100644 --- a/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js +++ b/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js @@ -57,6 +57,7 @@ function plugin(file, librarySettings, inputs) { // Check if file is a video. If it isn't then exit plugin. if (file.fileMedium !== 'video') { + // eslint-disable-next-line no-console console.log('File is not video'); response.infoLog += '☒File is not video \n'; response.processFile = false; @@ -65,7 +66,8 @@ function plugin(file, librarySettings, inputs) { // Check if inputs.language has been configured. If it hasn't then exit plugin. if (inputs.language === '') { - response.infoLog += '☒Language/s to keep have not been configured, please configure required options. Skipping this plugin. \n'; + response.infoLog += '☒Language/s to keep have not been configured, ' + + 'please configure required options. Skipping this plugin. \n'; response.processFile = false; return response; } diff --git a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js index 11be155..0279b6d 100644 --- a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js @@ -54,6 +54,7 @@ function plugin(file, librarySettings, inputs) { // Check if file is a video. If it isn't then exit plugin. if (file.fileMedium !== 'video') { + // eslint-disable-next-line no-console console.log('File is not video'); response.infoLog += '☒File is not video. \n'; response.processFile = false; @@ -145,7 +146,8 @@ function plugin(file, librarySettings, inputs) { // Convert file if convert variable is set to true. if (convert === true) { response.processFile = true; - response.preset = `, -map 0 -c:v copy -c:a copy ${ffmpegCommandInsert} -strict -2 -c:s copy -max_muxing_queue_size 9999 `; + response.preset = `, -map 0 -c:v copy -c:a copy ${ffmpegCommandInsert} ` + + '-strict -2 -c:s copy -max_muxing_queue_size 9999 '; } else { response.infoLog += '☑File contains all required audio formats. \n'; response.processFile = false; diff --git a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js index fc46245..1409788 100644 --- a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js +++ b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js @@ -14,7 +14,7 @@ function details() { }; } -function plugin(file, librarySettings) { +function plugin(file) { const response = { processFile: false, preset: '', diff --git a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js index 4be7183..fbc2822 100644 --- a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js +++ b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js @@ -1,3 +1,6 @@ +// eslint-disable-next-line import/no-unresolved +const request = require('request'); + /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ module.exports.details = function details() { return { @@ -45,12 +48,11 @@ module.exports.details = function details() { module.exports.plugin = function plugin(file, librarySettings, inputs) { // Set up required variables. - const request = require('request'); const ADDRESS = inputs.autoscan_address; const PORT = inputs.autoscan_port; const PASSKEY = inputs.autoscan_passkey; let filepath = ''; - const response = ''; + const response = {}; filepath = `${file.file}`; // Check if all inputs have been configured. If they haven't then exit plugin. @@ -78,12 +80,19 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { }, (error, res, body) => { if (error) { + // eslint-disable-next-line no-console console.error(error); } + // eslint-disable-next-line no-console console.log(`statusCode: ${res.statusCode}`); + // eslint-disable-next-line no-console console.log(body); }); + // eslint-disable-next-line no-console console.log('request next'); + // eslint-disable-next-line no-console console.log(request.post); + + return undefined; };