Skip to content

feat(online): server-side ordering, pagination, and load-more fix#2

Merged
Spieler1ONE1 merged 1 commit intoSpieler1ONE1:mainfrom
RomainFleury:feat/online-ordering-pagination
Mar 3, 2026
Merged

feat(online): server-side ordering, pagination, and load-more fix#2
Spieler1ONE1 merged 1 commit intoSpieler1ONE1:mainfrom
RomainFleury:feat/online-ordering-pagination

Conversation

@RomainFleury
Copy link
Copy Markdown
Contributor

@RomainFleury RomainFleury commented Mar 3, 2026

Note: I am not a python developer so there are quite some things that I might have missed. The behaviour seems ok:

  • infinite scroll
  • filters being applied (new/old, most downloaded, most liked)
  • search
  • and the roulette has been changed a bit to use a new api entry point that I added

Description

Server-side ordering and pagination for the Online tab so the list matches the website and "Load more" works correctly.

  • API integration: Use orderBy (latest/oldest/like/download) and hasNextPage; get_character_list returns (rows, has_next_page).
  • Scraper/workers: Pagination-only fetch; ScraperWorker supports order_by and multi-page initial load.
  • Online tab: Sort order matches the website by trusting API order for server-side sorts and refetching when the user changes to Date/Most Downloaded/Most Liked; Name A–Z remains client-side.
  • Load more: Button stays visible when the API reports more pages; last_fetched_api_page tracks which page to request next so we don't re-request already-fetched pages.
  • Roulette: Fetches 5 random characters from the API and refetches on "GIRAR DE NUEVO".
  • Docs: Added docs/API-INTEGRATION.md for API usage.

Fixes the list appearing "stuck" after the first few pages and ensures sort order matches star-citizen-characters.com.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue – load more / sort mismatch)

Checklist

  • My code follows the style guidelines of this project (flake8)
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (docs/API-INTEGRATION.md)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (existing tests pass; no new tests for online tab)

- API: orderBy (latest/oldest/like/download), hasNextPage, get_character_list returns (rows, has_next_page)
- Scraper/workers: pagination-only fetch, ScraperWorker supports order_by and multi-page
- Online tab: sort matches website (trust API order for server-side sorts; refetch on sort change)
- Load more: keep button when API has next page; track last_fetched_api_page so correct page is requested
- Roulette: 5 random from API, refetch on GIRAR DE NUEVO
- Add docs/API-INTEGRATION.md

Made-with: Cursor
@Spieler1ONE1 Spieler1ONE1 merged commit d6610b0 into Spieler1ONE1:main Mar 3, 2026
1 check passed
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.

2 participants