From cdd5ed36bff8f27c9cd3fe05171957da433f29d8 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 11 Sep 2024 05:16:56 +0200 Subject: [PATCH] Added redownload option to ignore index file. --- src/cli.js | 4 ++++ src/curate/posts.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cli.js b/src/cli.js index b3c265d..c0c9f4e 100644 --- a/src/cli.js +++ b/src/cli.js @@ -53,6 +53,10 @@ function getArgs() { describe: 'Only include posts before the oldest or the latest entry in the index', options: ['oldest', 'latest'], }) + .option('redownload', { + describe: 'Ignore index file and force a redownload of everything in the selection. Does not affect [before|after]-indexed', + type: 'boolean', + }) .option('archives', { describe: 'Search archives for deleted posts', type: 'boolean', diff --git a/src/curate/posts.js b/src/curate/posts.js index dc9f3c3..22b4d74 100644 --- a/src/curate/posts.js +++ b/src/curate/posts.js @@ -58,7 +58,7 @@ function curatePost(acc, post, user, index, indexed, processed, args) { }; if (indexed.entries.length) { - if (indexed.entries.find(entry => entry.id === post.id)) { + if (!args.redownload && indexed.entries.find(entry => entry.id === post.id)) { return { ...acc, indexedUpdated: [...acc.indexedUpdated, curatedPost] }; }