From 04730db544eea4dfb76190143382c81381645e7d Mon Sep 17 00:00:00 2001 From: Ross Younger Date: Fri, 2 Feb 2024 15:19:52 +1300 Subject: [PATCH] Deduplicate images loaded from multiple Flickr sources --- node_helper.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node_helper.js b/node_helper.js index 187e8c2..a16b40d 100644 --- a/node_helper.js +++ b/node_helper.js @@ -655,6 +655,9 @@ module.exports = NodeHelper.create({ for (const result of results) { images.push(...result); } + // Deduplicate + images = [... new Map(images.map(p => [p.id, p])).values()]; + // Each source fetches up to maximumImages images (in case some have fewer). // Apply shuffle now, as the consumer will truncate. if (config.shuffle) {