mwalbeck / twitchlite

A lightweight livestream indexer for twitch
MIT License
3 stars 0 forks source link

Next button in pagination is "neverending" #6

Open crunchprank opened 4 years ago

crunchprank commented 4 years ago

Environment OS: CentOS 7 PHP: 7.3.13 Apache: 2.4.6

Issue At the top of the page where the Prev/Next buttons are, the Next button is able to be clicked even when there are no longer streams to be displayed. It continues to bring up blank pages.

Expected Behavior Once you reach the limit of streams to be displayed, the Next button should become inaccessible.

Reproduce

Additional Information

mwalbeck commented 4 years ago

Twitch used to provide a variable with the total amount of streams available for one's query, but they removed it earlier this year. I haven't found an alternative for at least knowing when there are no more stream left, if the amount of streams is less than 1000 (Starting this year you can only access the first 1000 streams of any particular query).

The best I can think of, off the top of my head, is to compare the amount of streams returned with the specified limit and if amount of streams is less than the limit, disable the next button. It won't work for the edge case where the total amount of stream equal the limit, but it's the best solution I have at the moment.