[scraper] pass kitsuId when opening contents

This commit is contained in:
TheBeastLT
2020-05-19 12:36:39 +02:00
parent 336e44d569
commit 6c502b714a

View File

@@ -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 => {