Closed perrycate closed 1 year ago
Hello, I can help with this if you don't mind!
A simple solution would be to send a request to get the total number of pages, and use this number as the upper limit of the range (instead of hardcoded value of 10). Let me know your thoughts!
Sure thing, help is always welcome!
That solution seems reasonable! Let me know if you have any questions! Also, there are some moving parts adjacent to this in PR #57 - you might want to wait until that's in (hopefully very soon!) before working on this to avoid merge conflicts.
That PR is now merged!
PR link: #59
Fixed by PR #59 . Thanks again!
Currently our fetch script doesn't bother interacting with start.gg's pagination - we can request a page by index, and each page has 500 tournaments, so we just assume that there are fewer than 5,000 tournaments (seems to be the case in general), request 10 pages, and call it a day.
This has a few downsides:
We should instead request one page at a time and check the total number of pages included in the
PageInfo
(docs here, though I believe we're already requesting it) before making each request. This means we will make exactly as many requests as are necessary, and can return early anytime if we encounter an error.