mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] ignores duplicates when creating contents
This commit is contained in:
@@ -273,7 +273,7 @@ function getUnassignedSubtitles() {
|
|||||||
|
|
||||||
function createContents(infoHash, contents) {
|
function createContents(infoHash, contents) {
|
||||||
if (contents && contents.length) {
|
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 }));
|
.then(() => Torrent.update({ opened: true }, { where: { infoHash: infoHash }, silent: true }));
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
|
|||||||
Reference in New Issue
Block a user