perrycate / tournamap

Website to visualize Smash Ultimate tournaments near you
https://tournamap.gg
GNU General Public License v3.0
9 stars 6 forks source link

Handle paginated data from start.gg properly #59

Closed dknham closed 1 year ago

dknham commented 1 year ago

PR for #58

I considered two approaches for this:

  1. First request sent reads total number of pages from PageInfo. This number can be used as the upper limit of the range for the Enum.map call. This means we send an extra request just to get the total pages.
  2. To avoid the extra request, we can make get_tourney_page() a recursive function that adds entries from a page to an accumulative list and returns after the last page.

I went with approach 2, but I'm open to any other suggestions.

dknham commented 1 year ago

Thanks for your feedback. I made the changes as suggested.