1
Fork 0

batch-e621: just use tags array in JSON

This commit is contained in:
Conduitry 2024-04-25 18:08:20 -04:00
parent 4f7f2ca7fe
commit b6c82eb4f5

View file

@ -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 }));