From b6c82eb4f571b25bfeb702482c7b5e10e46d70c4 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 25 Apr 2024 18:08:20 -0400 Subject: [PATCH] batch-e621: just use tags array in JSON --- bin/batch-e621.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/batch-e621.js b/bin/batch-e621.js index 8d8cf62..5b04ada 100755 --- a/bin/batch-e621.js +++ b/bin/batch-e621.js @@ -32,8 +32,7 @@ for await (const { url, filename, tags, mtime } of get_files('date:day status:an } const last_run = await fs.promises.readFile('batch-e621.json').then(_ => JSON.parse(_.toString())).catch(() => ({})); -const normalized_tags = batch.tags.join(' '); -if (last_run.db_date === db_date && last_run.normalized_tags === normalized_tags) { +if (last_run.db_date === db_date && last_run.tags.join('\n') === batch.tags.join('\n')) { log('SKIPPED - Finding older matching posts from CSV dump'); } else { log('Finding older matching posts from CSV dump'); @@ -44,4 +43,4 @@ if (last_run.db_date === db_date && last_run.normalized_tags === normalized_tags } } -await batch.done() && await fs.promises.writeFile('batch-e621.json', JSON.stringify({ db_date, normalized_tags })); +await batch.done() && await fs.promises.writeFile('batch-e621.json', JSON.stringify({ db_date, tags: batch.tags }));