[scraper] fixes seeders update for imdb search providers

This commit is contained in:
TheBeastLT
2020-04-23 20:49:04 +02:00
parent a6b3b164aa
commit d0e0d7b581
3 changed files with 23 additions and 6 deletions

View File

@@ -25,8 +25,9 @@ async function scrape() {
}
async function updateSeeders(torrent, getImdbIdsMethod) {
return getImdbIdsMethod().then(imdbIds => Promises.sequence(imdbIds
.map(imdbId => limiter.schedule(() => eztv.search(imdbId)))));
return getImdbIdsMethod()
.then(imdbIds => Promise.all(imdbIds.map(imdbId => limiter.schedule(() => eztv.search(imdbId)))))
.then(results => results.reduce((a, b) => a.concat(b), []));
}
async function scrapeLatestTorrents() {