[scraper] filter non mapped horriblesubs episodes

This commit is contained in:
TheBeastLT
2020-03-13 18:38:57 +01:00
parent 21338b3aee
commit c09d7cf566

View File

@@ -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)