From 6c502b714ae4df0992dc010cf9aeaf04b170b673 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Tue, 19 May 2020 12:36:39 +0200 Subject: [PATCH] [scraper] pass kitsuId when opening contents --- scraper/lib/torrentEntries.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scraper/lib/torrentEntries.js b/scraper/lib/torrentEntries.js index 075e5eb..d2b47f8 100644 --- a/scraper/lib/torrentEntries.js +++ b/scraper/lib/torrentEntries.js @@ -113,8 +113,9 @@ async function createTorrentContents(torrent) { } const notOpenedVideo = storedVideos.length === 1 && !Number.isInteger(storedVideos[0].fileIndex); const imdbId = Promises.mostCommonValue(storedVideos.map(stored => stored.imdbId)); + const kitsuId = Promises.mostCommonValue(storedVideos.map(stored => stored.kitsuId)); - const { contents, videos, subtitles } = await parseTorrentFiles({ ...torrent.get(), imdbId }) + const { contents, videos, subtitles } = await parseTorrentFiles({ ...torrent.get(), imdbId, kitsuId }) .then(torrentContents => notOpenedVideo ? torrentContents : { ...torrentContents, videos: storedVideos }) .then(torrentContents => assignSubtitles(torrentContents)) .catch(error => {