Skip to content

fix(tv): keep a mixed library's Movies and Series browse filters apart - #532

Merged
Quick104 merged 1 commit into
Silo-Server:mainfrom
RXWatcher:fix/tv-mixed-library-browse-prefs
Oct 9, 2026
Merged

Quick104 merged 1 commit into
Silo-Server:mainfrom
RXWatcher:fix/tv-mixed-library-browse-prefs

Conversation

@RXWatcher

@RXWatcher RXWatcher commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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

BrowsePrefsStore takes 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 main 021c5eae:

  • Build supply-chain checks (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).
  • lintDebug for Android shared, phone and TV, plus phone and TV lintVitalRelease: no new issues beyond the baseline.
  • :androidApp:assembleDebug and :androidTvApp:assembleDebug: passed.
  • git diff --check main...HEAD: passed.
  • New regression test: a mixed library's Series tab opens on default Browse state and its own preserve toggle after Movies saved a sort, a filter and preserve off. It fails without the view-model change.

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

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code, GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verification pending
  • Adversarial review: n/a. The same agent read the remaining BrowsePrefsStore call 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.

  • Adds an optional media-scope parameter to BrowsePrefsStore key 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).
  • TvLibraryDetailViewModel passes its active media scope when reading the preserve setting, saving and restoring browse sort/filters, and toggling preserve (TvLibraryDetailViewModel.kt).
  • New test mixedLibraryMoviesAndSeriesKeepSeparateBrowseState verifies the two scopes keep independent defaults, preserve toggles, and saved sort state (TvLibraryBrowsePrefsTest.kt).
  • Behavioral Change: users upgrading will see their previously saved unscoped browse filters not applied to scoped Movies/Series views; they reset to defaults and are saved under new scoped keys.

Macroscope summarized 6e28be2.

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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T19:51:05.074187Z 6e28be2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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

silo-kody Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f1709bd9-232e-47ad-b568-78703b2bcd84

📥 Commits

Reviewing files that changed from the base of the PR and between 021c5ea and 6e28be2.


📒 Files selected for processing (3)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/settings/BrowsePrefsStore.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryDetailViewModel.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryBrowsePrefsTest.kt


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@Quick104 Quick104 added priority: P2 Limited scope, workaround exists, or polish impact: usability Core flow broken or severely blocked labels Oct 9, 2026 — with Cursor
@Quick104
Quick104 merged commit 67c58fc into Silo-Server:main Oct 9, 2026
8 of 9 checks passed
Quick104 added a commit to Rhainland/silo-android that referenced this pull request Oct 10, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact: usability Core flow broken or severely blocked priority: P2 Limited scope, workaround exists, or polish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants