fixing bug that basically caused infinite loop

This commit is contained in:
localhost 2023-09-16 11:04:55 +02:00
parent 1082050689
commit aa5bfec8b2
1 changed files with 2 additions and 2 deletions

View File

@ -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 >= 120) resolve(videos) if (videos.length >= 120) 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) {