Skip to content

Language filter from real catalogue values (#282)#27

Open
fabiodalez-dev wants to merge 1 commit into
mainfrom
feat/language-filter-from-catalog-282
Open

Language filter from real catalogue values (#282)#27
fabiodalez-dev wants to merge 1 commit into
mainfrom
feat/language-filter-from-catalog-282

Conversation

@fabiodalez-dev

Copy link
Copy Markdown
Owner

Fixes the Android side of #282 (HansUwe52). Pairs with the Pinakes backend PR that adds GET /api/v1/catalog/languages.

Problem

The search filter's language chips were a hardcoded ISO-code list (ita, eng, fra, deu, spa, lat) sent to the API as language=…. The backend stores libri.lingua as unnormalized free text (italiano, English, Deutsch, Français), so the code never matched: filtering by a language — alone or combined with category / author / publisher — returned no results. Category/author/publisher worked because they're sourced from the collection; language was the odd one out.

Fix

Load the language chips from GET /api/v1/catalog/languages — the real values present in the catalogue, with counts — exactly as the app already sources genres. A selected value is sent verbatim and matches (the backend also compares case/space-insensitively now).

  • LanguageValue(language, count) model.
  • catalog/languages in PinakesApi + CatalogRepository.
  • SearchViewModel: languages state + loadLanguages(); removed the hardcoded SearchLanguageOptions.
  • SearchFilterSheet: renders state.languages.

Notes

  • Depends on the backend /catalog/languages endpoint (Pinakes PR).
  • compileDebugKotlin BUILD SUCCESSFUL.
  • The "sort home list by title/author" part of #282 is a separate, smaller change — the catalog search already exposes title_asc/title_desc sort via BookSort; wiring a sort control on the browse screen can follow.

The search filter's language chips were a hardcoded ISO-code list ("ita", "eng",
"deu", …) sent to the API as `language=…`. But the backend stores `libri.lingua`
as unnormalized free text ("italiano", "English", "Deutsch", "Français"), so the
code never matched anything: filtering by a language — alone or combined with a
category / author / publisher — returned zero results (issue #282).

The app now loads the real language values from GET /api/v1/catalog/languages
(added on the backend), exactly as it already sources genres, and renders those
as the language chips. A selected language is sent verbatim and matches the
collection (the backend also compares case/space-insensitively now).

- Models: LanguageValue(language, count).
- PinakesApi + CatalogRepository: catalog/languages call.
- SearchViewModel: languages state + loadLanguages() in init; removed the
  hardcoded SearchLanguageOptions/LanguageOption.
- SearchFilterSheet: render state.languages instead of the fixed list.

Requires the backend /catalog/languages endpoint (Pinakes PR). compileDebugKotlin
BUILD SUCCESSFUL.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fabiodalez-dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e96b268-7691-4eb0-8151-710d44e0b708

📥 Commits

Reviewing files that changed from the base of the PR and between 4c8522f and f784929.

📒 Files selected for processing (5)
  • app/src/main/java/com/pinakes/app/data/model/Models.kt
  • app/src/main/java/com/pinakes/app/data/network/PinakesApi.kt
  • app/src/main/java/com/pinakes/app/data/repository/CatalogRepository.kt
  • app/src/main/java/com/pinakes/app/ui/screens/search/SearchFilterSheet.kt
  • app/src/main/java/com/pinakes/app/ui/screens/search/SearchViewModel.kt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/language-filter-from-catalog-282

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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