mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-17 03:06:27 -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
|
// Function required responses
|
||||||
// preset
|
// preset
|
||||||
// processFile
|
// processFile
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
function filterByAge(file, ageCutOff_Seconds, type) {
|
const filterByAge = (file, ageCutOff_Seconds, type) => {
|
||||||
try {
|
try {
|
||||||
const timeNow = new Date();
|
const timeNow = new Date();
|
||||||
const dateCreated = new Date(file.statSync.birthtime);
|
const dateCreated = new Date(file.statSync.birthtime);
|
||||||
|
|
@ -24,6 +24,6 @@ function filterByAge(file, ageCutOff_Seconds, type) {
|
||||||
};
|
};
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = filterByAge;
|
module.exports = filterByAge;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
function filterByBitrate(file, lowerBound, upperBound) {
|
const filterByBitrate = (file, lowerBound, upperBound) => {
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
file.bit_rate >= lowerBound
|
file.bit_rate >= lowerBound
|
||||||
|
|
@ -22,6 +22,6 @@ function filterByBitrate(file, lowerBound, upperBound) {
|
||||||
};
|
};
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = filterByBitrate;
|
module.exports = filterByBitrate;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
function filterByCodec(file, mode, codecs) {
|
const filterByCodec = (file, mode, codecs) => {
|
||||||
try {
|
try {
|
||||||
// console.log(file,mode,codecs)
|
// console.log(file,mode,codecs)
|
||||||
|
|
||||||
|
|
@ -54,6 +54,6 @@ function filterByCodec(file, mode, codecs) {
|
||||||
};
|
};
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = filterByCodec;
|
module.exports = filterByCodec;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
function filterByMedium(file, medium) {
|
const filterByMedium = (file, medium) => {
|
||||||
try {
|
try {
|
||||||
if (file.fileMedium !== medium) {
|
if (file.fileMedium !== medium) {
|
||||||
const response = {
|
const response = {
|
||||||
|
|
@ -19,6 +19,6 @@ function filterByMedium(file, medium) {
|
||||||
};
|
};
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = filterByMedium;
|
module.exports = filterByMedium;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
function filterByResolution(file, mode, resolution) {
|
const filterByResolution = (file, mode, resolution) => {
|
||||||
try {
|
try {
|
||||||
if (mode === 'exclude') {
|
if (mode === 'exclude') {
|
||||||
if (
|
if (
|
||||||
|
|
@ -40,6 +40,6 @@ function filterByResolution(file, mode, resolution) {
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error('Plugin error, no filter mode specified');
|
throw new Error('Plugin error, no filter mode specified');
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = filterByResolution;
|
module.exports = filterByResolution;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
function filterBySize(file, lowerBound, upperBound) {
|
const filterBySize = (file, lowerBound, upperBound) => {
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
file.file_size / 1000 >= lowerBound
|
file.file_size / 1000 >= lowerBound
|
||||||
|
|
@ -22,6 +22,6 @@ function filterBySize(file, lowerBound, upperBound) {
|
||||||
};
|
};
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = filterBySize;
|
module.exports = filterBySize;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ const loadDefaultValues = (inputs, details) => {
|
||||||
if (!inputs) {
|
if (!inputs) {
|
||||||
inputs = {};
|
inputs = {};
|
||||||
}
|
}
|
||||||
const defaultInputs = details().Inputs;
|
|
||||||
|
const dets = details();
|
||||||
|
const defaultInputs = dets.Inputs || dets.inputs || [];
|
||||||
for (let i = 0; i < defaultInputs.length; i += 1) {
|
for (let i = 0; i < defaultInputs.length; i += 1) {
|
||||||
if (typeof inputs[defaultInputs[i].name] === 'string') {
|
if (typeof inputs[defaultInputs[i].name] === 'string') {
|
||||||
inputs[defaultInputs[i].name] = inputs[defaultInputs[i].name].trim();
|
inputs[defaultInputs[i].name] = inputs[defaultInputs[i].name].trim();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue