mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -07:00
Update methods lint rules
This commit is contained in:
parent
f53b29efd4
commit
17f2dd6b3a
8 changed files with 16 additions and 14 deletions
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = function transcodeStandardiseAudioCodecs(file, audioEncoder) {
|
||||
module.exports = (file, audioEncoder) => {
|
||||
// Function required responses
|
||||
// preset
|
||||
// processFile
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function filterByAge(file, ageCutOff_Seconds, type) {
|
||||
const filterByAge = (file, ageCutOff_Seconds, type) => {
|
||||
try {
|
||||
const timeNow = new Date();
|
||||
const dateCreated = new Date(file.statSync.birthtime);
|
||||
|
|
@ -24,6 +24,6 @@ function filterByAge(file, ageCutOff_Seconds, type) {
|
|||
};
|
||||
return response;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = filterByAge;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function filterByBitrate(file, lowerBound, upperBound) {
|
||||
const filterByBitrate = (file, lowerBound, upperBound) => {
|
||||
try {
|
||||
if (
|
||||
file.bit_rate >= lowerBound
|
||||
|
|
@ -22,6 +22,6 @@ function filterByBitrate(file, lowerBound, upperBound) {
|
|||
};
|
||||
return response;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = filterByBitrate;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function filterByCodec(file, mode, codecs) {
|
||||
const filterByCodec = (file, mode, codecs) => {
|
||||
try {
|
||||
// console.log(file,mode,codecs)
|
||||
|
||||
|
|
@ -54,6 +54,6 @@ function filterByCodec(file, mode, codecs) {
|
|||
};
|
||||
return response;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = filterByCodec;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function filterByMedium(file, medium) {
|
||||
const filterByMedium = (file, medium) => {
|
||||
try {
|
||||
if (file.fileMedium !== medium) {
|
||||
const response = {
|
||||
|
|
@ -19,6 +19,6 @@ function filterByMedium(file, medium) {
|
|||
};
|
||||
return response;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = filterByMedium;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function filterByResolution(file, mode, resolution) {
|
||||
const filterByResolution = (file, mode, resolution) => {
|
||||
try {
|
||||
if (mode === 'exclude') {
|
||||
if (
|
||||
|
|
@ -40,6 +40,6 @@ function filterByResolution(file, mode, resolution) {
|
|||
}
|
||||
|
||||
throw new Error('Plugin error, no filter mode specified');
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = filterByResolution;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function filterBySize(file, lowerBound, upperBound) {
|
||||
const filterBySize = (file, lowerBound, upperBound) => {
|
||||
try {
|
||||
if (
|
||||
file.file_size / 1000 >= lowerBound
|
||||
|
|
@ -22,6 +22,6 @@ function filterBySize(file, lowerBound, upperBound) {
|
|||
};
|
||||
return response;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = filterBySize;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ const loadDefaultValues = (inputs, details) => {
|
|||
if (!inputs) {
|
||||
inputs = {};
|
||||
}
|
||||
const defaultInputs = details().Inputs;
|
||||
|
||||
const dets = details();
|
||||
const defaultInputs = dets.Inputs || dets.inputs || [];
|
||||
for (let i = 0; i < defaultInputs.length; i += 1) {
|
||||
if (typeof inputs[defaultInputs[i].name] === 'string') {
|
||||
inputs[defaultInputs[i].name] = inputs[defaultInputs[i].name].trim();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue