fixing bug that basically caused infinite loop
This commit is contained in:
parent
c2f81583a3
commit
e66f2c5c2d
|
@ -66,9 +66,9 @@ async function getChannelVideos(id) {
|
||||||
const page = await (await fetch(`${instance}/nextpage/channel/${id}?nextpage=${encodeURIComponent(payload)}`)).json()
|
const page = await (await fetch(`${instance}/nextpage/channel/${id}?nextpage=${encodeURIComponent(payload)}`)).json()
|
||||||
videos.push(...page.relatedStreams)
|
videos.push(...page.relatedStreams)
|
||||||
|
|
||||||
if (videos.length >= 60) resolve(videos)
|
if (videos.length >= 60) return resolve(videos)
|
||||||
if (page.nextpage) await getNextPage(page.nextpage)
|
if (page.nextpage) await getNextPage(page.nextpage)
|
||||||
else resolve(videos)
|
else return resolve(videos)
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue