From 2f8fca03276a23d35331fae1c43a52661dcc2cb3 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 20 Oct 2020 00:05:23 +0200 Subject: [PATCH] Added missing-date as config and argument alias. --- config/default.js | 2 +- src/argv.js | 4 ++-- src/updates.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/default.js b/config/default.js index 033ce1ab..cc39f449 100644 --- a/config/default.js +++ b/config/default.js @@ -189,7 +189,7 @@ module.exports = { ], }, fetchAfter: [1, 'week'], - noDateLimit: 3, + missingDateLimit: 3, media: { path: './media', thumbnailSize: 320, // width for 16:9 will be exactly 576px diff --git a/src/argv.js b/src/argv.js index a0219ca0..f077694d 100644 --- a/src/argv.js +++ b/src/argv.js @@ -142,11 +142,11 @@ const { argv } = yargs describe: 'Get the latest x releases, no matter the date range', type: 'number', }) - .option('no-date-limit', { + .option('missing-date-limit', { describe: 'Limit amount of scenes when dates are missing.', type: 'number', default: config.noDateLimit, - alias: ['null-date-limit', 'limit'], + alias: ['no-date-limit', 'null-date-limit', 'limit'], }) .option('page', { describe: 'Page to start scraping at', diff --git a/src/updates.js b/src/updates.js index a4d1daec..fee808f6 100644 --- a/src/updates.js +++ b/src/updates.js @@ -73,7 +73,7 @@ function needNextPage(pageReleases, accReleases, isUpcoming) { } if (!pageReleases.every(release => !!release.date)) { // some scenes don't have dates - return accReleases.length + pageReleases.length < argv.noDateLimit; + return accReleases.length + pageReleases.length < argv.missingDateLimit; } if (argv.after) { @@ -117,7 +117,7 @@ async function scrapeReleases(scraper, entity, preData, isUpcoming) { const limitedReleases = (argv.last && releases.slice(0, Math.max(argv.last, 0))) || (hasDates && releases.filter(release => moment(release.date).isAfter(argv.after))) - || releases.slice(0, Math.max(argv.noDateLimit, 0)); + || releases.slice(0, Math.max(argv.missingDateLimit, 0)); const { uniqueReleases, duplicateReleases } = argv.force ? { uniqueReleases: limitedReleases, duplicateReleases: [] }