Repository navigation
fix(tv): keep a mixed library's Movies and Series browse filters apart - #532
Conversation
Android TV saved Browse sort and filters per library, so a mixed library's Movies and Series tabs shared one saved state and one "Preserve sort & filters" toggle. A genre or sort chosen under Movies reopened under Series. Save them per media scope: a scoped view of a mixed library uses its own `.type-<scope>` key in BrowsePrefsStore. Unscoped libraries keep their existing keys, so saved state from before this change still restores. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
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. Comment |
Conflicts with main's library-list re-check (Silo-Server#487), hidden libraries (Silo-Server#517), household management (Silo-Server#493), and TV library browse (Silo-Server#468, Silo-Server#532) were resolved by keeping both sides: - LibrariesViewModel uses main's queued re-check loop, which already keeps an older library list from landing after a newer refresh, so the PR's separate job cancel is dropped. refreshAfterAccessChange() still clears the loaded subtabs and facets first. - The profile pickers keep both the stale-profile reload and main's manage-mode exit. - TvMainShell keys the library load on the hidden-libraries revision, the retry counter, and the access key. - libraryListChangedSinceCached() now goes through recheckUserLibraries(). Main caches only the visible libraries and confirms a short list before trusting it; comparing that cache with the raw server list would report an access change on every foreground return for a profile that hides a library, and would write hidden libraries back into the cache. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
Related issue: N/A
Validation tasks: none
On Android TV, a mixed library appears under both the Movies and the Series tab (#441), but the Browse sort and filters saved by #468 are keyed by library only. Both tabs read and write one saved state and one "Preserve sort & filters" toggle. A genre or sort chosen under Movies reopens under Series after a restart, and turning preserve off under one tab turns it off under the other.
This change keeps them apart: each tab of a mixed library saves its own Browse state.
Approach
BrowsePrefsStoretakes an optional media scope and appends.type-<scope>to the key when one is given. The TV library view passes its Movies or Series scope, which is only set for a mixed library. Every other library keeps its existing key, so state saved before this change still restores.The store change is the same one the phone needs for its Movies/Series chips in #447, byte for byte, so whichever pull request merges second applies cleanly.
Validation
On head
6e28be2a, on main021c5eae:test-check-build-supply-chain.sh,check-build-supply-chain.sh): passed../gradlew testDebugUnitTest: 5,608 tests, zero failures, errors or skips (815 phone, 1,244 TV, 1,835 shared, 1,712 Android shared, 2 libass bridge).lintDebugfor Android shared, phone and TV, plus phone and TVlintVitalRelease: no new issues beyond the baseline.:androidApp:assembleDebugand:androidTvApp:assembleDebug: passed.git diff --check main...HEAD: passed.Evidence
Evidence: not captured. The change decides which saved sort and filters a mixed library's Movies or Series Browse grid opens with after a restart. No screen layout changes. Unit tests cover the behaviour (see Validation). If a maintainer wants native captures, I will add Movies/Series Browse screenshots from a synthetic mixed library.
Risks
#468 has not shipped in a release yet, so no released TV build has saved state under the unscoped key for a mixed library. Movie, series and music libraries keep their keys and are unaffected.
Checklist
AI Disclosure
claude-opus-5-5BrowsePrefsStorecall sites on TV and phone to confirm unscoped libraries keep their keys. No independent reviewer was used.Note
Keep Movies and Series browse filters separate in mixed TV libraries
In a mixed library, the Movies and Series views previously shared one saved browse state, so filters set in one view carried over to the other.
BrowsePrefsStorekey building and all state read/write methods, so scoped views store state under type-specific keys while unscoped callers keep the existing keys (BrowsePrefsStore.kt).TvLibraryDetailViewModelpasses its active media scope when reading the preserve setting, saving and restoring browse sort/filters, and toggling preserve (TvLibraryDetailViewModel.kt).mixedLibraryMoviesAndSeriesKeepSeparateBrowseStateverifies the two scopes keep independent defaults, preserve toggles, and saved sort state (TvLibraryBrowsePrefsTest.kt).Macroscope summarized 6e28be2.