From c09d7cf5661815b0c5a1871c797db4fd34edcff8 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Fri, 13 Mar 2020 18:38:57 +0100 Subject: [PATCH] [scraper] filter non mapped horriblesubs episodes --- scraper/scrapers/horriblesubs/horriblesubs_scraper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scraper/scrapers/horriblesubs/horriblesubs_scraper.js b/scraper/scrapers/horriblesubs/horriblesubs_scraper.js index 94e8e85..882b862 100644 --- a/scraper/scrapers/horriblesubs/horriblesubs_scraper.js +++ b/scraper/scrapers/horriblesubs/horriblesubs_scraper.js @@ -135,7 +135,7 @@ async function _parseShowData(showData) { return kitsuIdsMapping[episode].kitsuId; } else if (Array.isArray(kitsuId)) { console.warn(`Unmapped episode number for ${showData.title} - ${inputEpisode}`); - return kitsuId[kitsuId.length - 1]; + return undefined; } return kitsuId; }; @@ -155,6 +155,7 @@ async function _parseShowData(showData) { uploadDate: episodeInfo.uploadDate, }))) .reduce((a, b) => a.concat(b), []) + .filter((incompleteTorrent) => incompleteTorrent.kitsuId) .map((incompleteTorrent) => entryLimiter.schedule(() => checkIfExists(incompleteTorrent) .then((torrent) => torrent && updateCurrentSeeders(torrent)) .then((torrent) => torrent && parseTorrentFiles(torrent)