[scraper] encode uri component for kitsu id query

This commit is contained in:
TheBeastLT
2020-12-19 14:52:12 +01:00
parent 910027358e
commit b39e54e2e0
5 changed files with 7 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ async function getCatalog(apiKey, offset = 0) {
return AD.magnet.status()
.then(response => response.data.magnets)
.then(torrents => (torrents || [])
.filter(torrent => statusReady(torrent.statusCode))
.filter(torrent => torrent && statusReady(torrent.statusCode))
.map(torrent => ({
id: `${KEY}:${torrent.id}`,
type: Type.OTHER,

View File

@@ -78,7 +78,7 @@ async function getCatalog(apiKey, offset = 0) {
return _getAllTorrents(RD)
.then(torrents => Array.isArray(torrents) ? torrents : [])
.then(torrents => torrents
.filter(torrent => statusReady(torrent.status))
.filter(torrent => torrent && statusReady(torrent.status))
.map(torrent => ({
id: `${KEY}:${torrent.id}`,
type: Type.OTHER,