[scraper] populate kitsuId for movies in series torrents

This commit is contained in:
TheBeastLT
2020-03-29 12:20:27 +02:00
parent 951add6851
commit 04b3d8a774

View File

@@ -110,13 +110,16 @@ async function mapSeriesEpisode(file, torrent, files) {
}
async function mapSeriesMovie(file, torrent) {
return findMovieImdbId(file).then((imdbId) => [{
infoHash: torrent.infoHash,
fileIndex: file.fileIndex,
title: file.path || file.name,
size: file.size,
imdbId: imdbId
}])
return findMovieImdbId(file)
.then(imdbId => getMetadata(imdbId, Type.MOVIE).catch(() => ({ imdbId })))
.then(metadata => [{
infoHash: torrent.infoHash,
fileIndex: file.fileIndex,
title: file.path || file.name,
size: file.size,
imdbId: metadata.imdbId,
kitsuId: metadata.kitsuId
}]);
}
function parseSeriesFile(file, parsedTorrentName) {