From b333607209b31b85979ddda218c7099bbfafc6ee Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Tue, 12 Jan 2021 12:15:05 +0100 Subject: [PATCH] [scraper] ignores duplicates when creating contents --- scraper/lib/repository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scraper/lib/repository.js b/scraper/lib/repository.js index 0831e68..77ab7c3 100644 --- a/scraper/lib/repository.js +++ b/scraper/lib/repository.js @@ -273,7 +273,7 @@ function getUnassignedSubtitles() { function createContents(infoHash, contents) { if (contents && contents.length) { - return Content.bulkCreate(contents.map(content => ({ infoHash, ...content }))) + return Content.bulkCreate(contents.map(content => ({ infoHash, ...content })), { ignoreDuplicates: true }) .then(() => Torrent.update({ opened: true }, { where: { infoHash: infoHash }, silent: true })); } return Promise.resolve();