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

Add horizontal pagination for views #243

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from

Conversation

pannal
Copy link
Contributor

@pannal pannal commented Aug 28, 2018

GHI (If applicable): #

Description:

  • adds pagination for episodes in season views (fixing performance issues with big seasons, e.g.: anime)
  • adds pagination for onDeck items in postplay
  • adds pagination for related items everywhere - increasing the related item count to 36 (artificial limit, PMS API "bug" reported)
  • 8 items per page by default and 4 possible orphans per side

Known issues:

  • related items PMS API query is slow, hence the artificial limit
  • related items PMS API results order is inconsistent (using the same offset/start value doesn't yield the same results for the next page)

Checklist:

  • I have based this PR against the develop branch

@pannal
Copy link
Contributor Author

pannal commented Aug 28, 2018

Possible followup PR:

  • make page size and orphans configurable via advanced setting
  • make artificial related item limit configurable as well?

@pannal
Copy link
Contributor Author

pannal commented Aug 31, 2018

Found an off by one. Fixing it tomorrow.

@ruuk ruuk force-pushed the develop branch 3 times, most recently from 78f9acc to 126aaba Compare August 31, 2018 22:50
@pannal
Copy link
Contributor Author

pannal commented Sep 5, 2018

Good to go.

Copy link
Contributor

@ruuk ruuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, except I think it would be better if we keep some of the current items when you page, so you have a page size and window i.e. if the window size is 16 and you had 8 and you added 8, 16 would be showing. If you add 8 more you take 8 off the beginning and have still a window of 16 showing. This would allow correcting the list jump after paging by first selecting an item in the wrong direction and then the correct item so that the focus position in the end remains on either the right or the left depending on where it was before the page.

lib/windows/pagination.py Show resolved Hide resolved
@pannal
Copy link
Contributor Author

pannal commented Nov 14, 2018

I've added an initialPageSize attribute, which is set to 18, and increased the orphan count to 8, so an initial load would not paginate for 26 items. Afterwards it continues with pages of 8 with an orphan size of 8 (at the beginning or end of the list).

@pannal
Copy link
Contributor Author

pannal commented Nov 15, 2018

@ruuk we should probably still set a lower page size for related items and extras, as those requests take considerably longer. I'd go with 8+4 in those cases.

@pannal
Copy link
Contributor Author

pannal commented Oct 24, 2019

Commit 8114d11 is semi-related; it depends on this PR, though.

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

Successfully merging this pull request may close these issues.

None yet

2 participants