diff --git a/Community/Tdarr_Plugin_tsld_filter_modified_date.js b/Community/Tdarr_Plugin_tsld_filter_modified_date.js index 38e5b16..6015f26 100644 --- a/Community/Tdarr_Plugin_tsld_filter_modified_date.js +++ b/Community/Tdarr_Plugin_tsld_filter_modified_date.js @@ -22,9 +22,9 @@ const details = () => ({ 365 \\nExample:\\n - 30` + 30`, }, - ] + ], }); // eslint-disable-next-line no-unused-vars @@ -36,26 +36,21 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { processFile: true, infoLog: '', }; - //response.infoLog += `Filter preventing processing. File mod time ${file.statSync.mtimeMs}`; - //response.infoLog += ` Now ${Date.now()}`; + // response.infoLog += `Filter preventing processing. File mod time ${file.statSync.mtimeMs}`; + // response.infoLog += ` Now ${Date.now()}`; const age = Date.now() - file.statSync.mtimeMs; const reqage = Number(inputs.minModifiedDaysOld) * 86400000; // response.infoLog += ` Age ${age} Require Min Age: ${reqage}`; - if (reqage < age) - { - response.infoLog += "File modified date old enough. Moving to next plugin."; - response.processFile = true; + if (reqage < age) { + response.infoLog += 'File modified date old enough. Moving to next plugin.'; + response.processFile = true; + } else { + response.infoLog += 'Skipping, file modified date not old enough'; + response.processFile = false; } - else - { - response.infoLog += "Skipping, file modified date not old enough"; - response.processFile = false; - } - return response; }; module.exports.details = details; module.exports.plugin = plugin; - diff --git a/tests/Community/Tdarr_Plugin_tsld_filter_modified_date.js b/tests/Community/Tdarr_Plugin_tsld_filter_modified_date.js index ffc6852..f6b10e6 100644 --- a/tests/Community/Tdarr_Plugin_tsld_filter_modified_date.js +++ b/tests/Community/Tdarr_Plugin_tsld_filter_modified_date.js @@ -7,7 +7,7 @@ const tests = [ file: require('../sampleData/media/sampleH264_2.json'), librarySettings: {}, inputs: { - minModifiedDaysOld: 1 + minModifiedDaysOld: 1, }, otherArguments: {}, }, @@ -21,13 +21,13 @@ const tests = [ file: require('../sampleData/media/sampleH264_1.json'), librarySettings: {}, inputs: { - minModifiedDaysOld: 9999 + minModifiedDaysOld: 9999, }, otherArguments: {}, }, output: { processFile: false, - infoLog: 'Skipping, file modified date not old enough', + infoLog: 'Skipping, file modified date not old enough', }, }, { @@ -35,7 +35,7 @@ const tests = [ file: require('../sampleData/media/sampleH264_1.json'), librarySettings: {}, inputs: { - minModifiedDaysOld: 1 + minModifiedDaysOld: 1, }, otherArguments: {}, }, @@ -49,7 +49,7 @@ const tests = [ file: require('../sampleData/media/sampleH264_1.json'), librarySettings: {}, inputs: { - minModifiedDaysOld: 9999 + minModifiedDaysOld: 9999, }, otherArguments: {}, }, @@ -60,4 +60,4 @@ const tests = [ }, ]; -run(tests); \ No newline at end of file +run(tests);