From 240146e554cc14e8750441c685838759be426682 Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Sun, 1 Jul 2018 00:22:17 +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] }; }