Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next button in pagination is "neverending" #6

Open
crunchprank opened this issue Jul 19, 2020 · 1 comment
Open

Next button in pagination is "neverending" #6

crunchprank opened this issue Jul 19, 2020 · 1 comment

Comments

@crunchprank
Copy link

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

  • Clone the repository
  • Browse to the main index.php page
  • Search for a game (i.e. just use Cuphead for an example)
  • Continue clicking "Next"

Additional Information

@mwalbeck
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants