Fix lint errors

This commit is contained in:
HaveAGitGat 2023-09-25 08:28:37 +01:00
parent 73482c5a10
commit cbbae8e67a

View file

@ -1,3 +1,5 @@
/* eslint-disable max-len */
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const loadDefaultValues = require('../methods/loadDefaultValues'); const loadDefaultValues = require('../methods/loadDefaultValues');
@ -63,7 +65,9 @@ const details = () => ({
], ],
}); });
// 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
inputs = loadDefaultValues(inputs, details); inputs = loadDefaultValues(inputs, details);
const fileNameOld = file._id; const fileNameOld = file._id;
@ -92,7 +96,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
x265: 'h265', x265: 'h265',
h264: 'h264', h264: 'h264',
h265: 'h265', h265: 'h265',
dts: 'DTS-X', // dts: 'DTS-X',
'dts-hd ma': 'DTS-HD MA', 'dts-hd ma': 'DTS-HD MA',
'dts-es': 'DTS-HD ES', 'dts-es': 'DTS-HD ES',
'dts-hd hra': 'DTS-HD HRA', 'dts-hd hra': 'DTS-HD HRA',
@ -114,7 +118,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
if (videoCodec in codecMap) { if (videoCodec in codecMap) {
const renamedCodec = codecMap[videoCodec]; const renamedCodec = codecMap[videoCodec];
// eslint-disable-next-line no-param-reassign
file._id = file._id.replace(videoCodecRegex, renamedCodec); file._id = file._id.replace(videoCodecRegex, renamedCodec);
// eslint-disable-next-line no-param-reassign
file.file = file.file.replace(videoCodecRegex, renamedCodec); file.file = file.file.replace(videoCodecRegex, renamedCodec);
} }
} }
@ -127,7 +133,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
if (audioCodec in codecMap) { if (audioCodec in codecMap) {
const renamedCodec = codecMap[audioCodec]; const renamedCodec = codecMap[audioCodec];
// eslint-disable-next-line no-param-reassign
file._id = file._id.replace(audioCodecRegex, renamedCodec); file._id = file._id.replace(audioCodecRegex, renamedCodec);
// eslint-disable-next-line no-param-reassign
file.file = file.file.replace(audioCodecRegex, renamedCodec); file.file = file.file.replace(audioCodecRegex, renamedCodec);
} }
} }
@ -166,7 +174,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
}); });
response.infoLog += `${directoryPath}/${supportFile} renamed to ${directoryPath}/${renamedFileWithBothCodecs}\n`; response.infoLog += `${directoryPath}/${supportFile} renamed to ${directoryPath}/${renamedFileWithBothCodecs}\n`;
additionalFilesCount++; // Increment the count for each additional file found additionalFilesCount += 1; // Increment the count for each additional file found
} }
}); });