mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] fixes featurette and redundant files detection
This commit is contained in:
@@ -47,15 +47,16 @@ async function parseMovieFiles(torrent, parsedName, metadata) {
|
||||
}
|
||||
|
||||
const parsedVideos = await Promises.sequence(filteredVideos
|
||||
.map(video => () => findMovieImdbId(video.name)
|
||||
.then(newImdbId => ({
|
||||
infoHash: torrent.infoHash,
|
||||
fileIndex: video.fileIndex,
|
||||
title: video.path || video.name,
|
||||
size: video.size,
|
||||
imdbId: newImdbId,
|
||||
})))
|
||||
.map(video => isFeaturette(video) ? clearInfoFields(video) : video));
|
||||
.map(video => () => isFeaturette(video)
|
||||
? Promise.resolve(video)
|
||||
: findMovieImdbId(video.name).then(imdbId => ({ ...video, imdbId }))))
|
||||
.then(videos => videos.map(video => ({
|
||||
infoHash: torrent.infoHash,
|
||||
fileIndex: video.fileIndex,
|
||||
title: video.path || video.name,
|
||||
size: video.size,
|
||||
imdbId: video.imdbId,
|
||||
})));
|
||||
return { contents, videos: parsedVideos, subtitles };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user