Add server-side pagination to recommendations view #13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The recommendations view currently fetches only the first page of results (Trakt API default: 10 items). Power users with large recommendation queues cannot access items beyond the first page.
Fix: pass
?page=N&limit=Nto the Trakt recommendations endpoint. A DOWN-arrow keypress on the existing...sentinel row replaces the current table with the next page.Findings:
get_recommendationsinapi_actions.pycurrently fetches a single page (no pagination params). Trakt returns pagination headers (X-Pagination-Page,X-Pagination-Page-Count). The TUI already has a__more__sentinel row in_populate_items_tablebut no keybinding wires it up.Plan:
RecommendationsPage(items, has_more)NamedTuple andlimitparam toTraktApi. Updateget_recommendationsto pass?page=N&limit=N, parse response headers forhas_more.recommendation_page,_is_paginated_view,_on_more_sentineltoRecommendApp. Addon_keyhandler: DOWN on sentinel + paginated view → increment page, reload. Unrated-watched views set_is_paginated_view=Falseso their sentinel remains inert.Both tasks are TDD — failing tests written first.