Skip to content

Fix browse pagination and infinite scroll for GROUPED duplicate handling - #181

Open
disclosurez wants to merge 1 commit into
Davidona:masterfrom
disclosurez:fix/pagination-grouped-cursor
Open

Fix browse pagination and infinite scroll for GROUPED duplicate handling#181
disclosurez wants to merge 1 commit into
Davidona:masterfrom
disclosurez:fix/pagination-grouped-cursor

Conversation

@disclosurez

Copy link
Copy Markdown
Contributor

Three fixes for browsing with GROUPED (or SMART) VOD duplicate handling mode:

  1. Allow cursor browsing with GROUPEDcanUseCursorWindow previously required duplicateHandlingMode == SHOW_ALL. Removed that check so GROUPED mode uses the efficient cursor pagination path instead of the capped 200-item non-cursor path.

  2. Fix canLoadMore for GROUPED — The totalCount for GROUPED mode was computed from a full non-cursor load (capped at SEARCH_RESULT_LIMIT=200), but the cursor path could load more items than that. Once the cursor exceeded 200 items, canLoadMore became false, stopping infinite scroll prematurely. Now uses the actual database count (rawTotalCount) regardless of duplicate handling mode.

  3. Remove added_at > 0 filter from FreshCursor queries — Items with added_at=0 (null/deprecated from provider) were excluded from cursor results but still counted in the total. This caused canLoadMore to stay true forever without loading new items. Removed the filter from all movie FreshCursor and FreshByCategoryCursor queries so the cursor returns all items matching the provider/category.

Files changed

  • data/.../repository/MovieRepositoryImpl.kt — canUseCursorWindow + totalCount
  • data/.../repository/SeriesRepositoryImpl.kt — canUseCursorWindow + totalCount
  • data/.../local/dao/Daos.kt — removed added_at>0 from 6 FreshCursor queries

…filter

Three independent fixes for browsing with GROUPED duplicate handling:

1. Remove SHOW_ALL requirement from canUseCursorWindow — allows the
   cursor pagination path to be used with GROUPED mode, giving proper
   infinite scroll instead of the capped 200-item non-cursor path.

2. Use rawTotalCount for canLoadMore — previously GROUPED mode computed
   totalCount from a non-cursor path capped at SEARCH_RESULT_LIMIT=200,
   causing canLoadMore to go false once the cursor loaded more than 200
   items. Now uses the actual database count.

3. Remove added_at > 0 filter from FreshCursor queries — items with
   added_at=0 were excluded from cursor results but counted in the total,
   causing canLoadMore to stay true forever without loading new items.
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.

1 participant