moves movies ids inside torrent object

This commit is contained in:
TheBeastLT
2020-02-13 09:52:40 +01:00
parent 30419f3c64
commit 42ac44d1d9
4 changed files with 231 additions and 37 deletions

View File

@@ -63,10 +63,10 @@ async function enrichShow(show) {
return {
showId: showId,
kitsu_id: metadata.kitsuId,
...show,
kitsu_id: metadata.kitsu_id,
kitsuTitle: metadata.name,
imdb_id: metadata.imdb_id
kitsuTitle: metadata.title,
imdb_id: metadata.imdbId
}
}
@@ -89,12 +89,13 @@ async function _parseShowData(showData) {
title: `${episodeInfo.title} - ${episodeInfo.episode} [${mirror.resolution}]`,
size: 300000000,
type: Type.ANIME,
kitsuId: kitsuId,
uploadDate: episodeInfo.uploadDate,
})))
.reduce((a, b) => a.concat(b), [])
.map((incompleteTorrent) => entryLimiter.schedule(() => checkIfExists(incompleteTorrent)
.then((torrent) => torrent && updateCurrentSeeders(torrent))
.then((torrent) => torrent && parseTorrentFiles(torrent, undefined, kitsuId)
.then((torrent) => torrent && parseTorrentFiles(torrent)
.then((files) => verifyFiles(torrent, files))
.then((files) => repository.createTorrent(torrent)
.then(() => files.forEach(file => repository.createFile(file)))