Repository navigation
feat(settings): hide spoilers for unwatched episodes, per profile - #427
Merged
Merged
Conversation
Adopt the settings contract at revision 15, which adds the profile settings catalog.hide_unwatched_episode_images and catalog.hide_unwatched_episode_overviews. When a profile turns them on, the phone and TV apps blur the still and hide the description of episodes the profile has not started: episode rails, the series hero, episode detail, Continue Watching / Next Up cards, the TV home marquee, and the players' next-episode screens. A Spoilers group in Settings holds the two switches, shown only when the server serves revision 15. Below API 31, where Modifier.blur does nothing, a hidden still shows only its ThumbHash. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…nges The spoiler store remembered only that it had loaded, not for which server and profile. After Add Server and sign-in, it kept the previous server's answer until the app restarted. It now follows the active server and profile and ties each load to them. The series hero also no longer reserves an empty block where a hidden episode description would have been. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
|
Problem
Related issue: #28 (item 3); dependency: Silo-Server/silo-server#1709.
Pairs with Silo-Server/silo-apple#559.
Validation tasks: #347 C2/C4/C8/C9, #348 C2/C4/C8/C9, #315 C1, #316 C1.
Episode stills and descriptions can reveal events before a viewer starts an episode. This PR applies the two profile settings from settings contract revision 17 across Android phone and TV, including Downloads and the TV launcher Watch Next row.
Solution
Use one shared unwatched rule: neither played nor in progress, with no positive saved position. Resolve and write both settings at profile scope. Cache by server and profile, pin the value read and writes to the originating profile, cancel obsolete hydration on identity changes, preserve pending optimistic toggles during refresh, and bind completed writes to their original cache identity.
Apply protection to episode rails, catalog/search/personal grids, descriptions, detail fallbacks, Next Up and Continue Watching cards, the TV marquee, player next-episode screens, and experimental Watch Party previews (picker confirmation, staged title, invite page, and suggestion posters), matching silo-apple#559. Rebuild displayed and pending marquee projections when preferences change, and refresh their source items when row watch state changes. Image provenance preserves explicit series artwork and protects unknown episode artwork conservatively; detail heroes and the TV marquee's detail backdrop follow the provenance of the artwork they show. Catalog actions clear progress with optimistic watched changes. When the current write fails, they undo only the fields they changed, unless a newer reload has replaced them. The shuffle post-roll uses the pick's own watch state. Image protection and detail handoffs use that live position. API 31 and later blur protected stills; earlier versions use ThumbHash or a neutral placeholder. Hidden descriptions are omitted.
Downloads persist poster provenance and episode watch state through Room schema 15. Leaf rows and inherited series/season headers apply the same image treatment. While image protection is on, the tab refreshes current episode user data through authenticated network reads on entry, resume, and manual refresh, with at most four concurrent requests. Pending watch/progress writes and watch/progress mutations made during the read retain precedence; older acknowledged state yields to the server. Separate mutation timestamps prevent ratings and track choices from promoting stale watch data. A shared generation guard rejects older section rebuilds after a newer refresh or deletion. New series posters remain visible; older downloads with unknown artwork provenance are protected conservatively.
Watch Next resolves profile preferences in its background worker. Protected episodes use explicit safe artwork from the row or a parent-series lookup. Portrait fallback keeps its aspect ratio. If no safe artwork exists, the tile is omitted. Enabling image protection clears previously published tiles and queues a new sync. Known unchanged settings preserve tiles on offline startup; unresolved hydration does not change the stored launcher protection state. The publisher rejects obsolete identity, generation, and preference snapshots.
Validation
917bf6189(current head): extends the picker's own-progress protection to TV poster cards, and orders the Watch Next authority fence so the owner is checked last. TV unit tests (1,269) and debug lint pass.01bb7fda9: fences every Watch Next write against a mid-run cast identity. The TV party picker now uses this profile's own watch state for spoilers. TV unit tests (1,269) pass.994c31b6f: a protection change on a fading TV marquee layer now drops only what is newly hidden and keeps explicit series artwork. TV unit tests (1,268) and debug lint pass.4d8eaa7bd: applies a protection change to marquee layers still fading out on TV.b8e467740: keeps a phone's temporary cast identity from seeding the TV launcher. Makes the TV marquee hide a newly protected still at once. Reports failed spoiler-setting saves in phone and TV Settings. android-shared (1,748), phone (840), and TV (1,266) unit tests and debug lint pass.c57fcc8b0: Home and the TV detail page clear resume progress when an episode is marked unwatched. The phone Watch Party picker tiles are protected. Forced profile recovery clears the spoiler store on phone and TV. Shared (1,905), phone (840), and TV (1,266) unit tests and debug lint pass.002cfa6ee: hides the current phone room backdrop immediately when protection turns on. Phone debug build and lint pass.e1a4b8c92: keeps a protected still hidden while the phone room backdrop crossfades, and protects the TV invite page opened from the player. Phone (840) and TV (1,266) unit tests and debug lint pass.5ab98ba3c: extends protection to Watch Party previews on phone and TV. Locally, 5,759 debug unit tests pass with zero failures (shared 1,905, including the newWatchPartySpoilersTest; android-shared 1,748; phone 840; TV 1,266), and phone and TV debug lint pass with no baseline change.a68c70c53: pins the spoiler value read to the same captured auth scope. android-shared unit tests (1,748) pass.8b4a11834: pins each spoiler-setting write to the auth scope captured with the store's identity, so a server or profile switch can't retarget a queued toggle. A newEpisodeSpoilerStoreTestcase fails without it. Locally, android-shared (1,748), phone (840), and TV (1,266) unit tests pass, and phone and TV debug lint pass.4b6a4e791: fixes how a failed watched toggle rolls back after new playback progress. Phone unit tests (840, including the newWatchedRollbackTest) and phone debug lint pass.9478b55f6: CI passed. Locally, 5,749 debug unit tests passed with zero failures (shared 1,899, android-shared 1,747, phone 837, TV 1,266). Phone and TV debug lint passed with no baseline change. A newEpisodeSpoilerStoreTestcase holds a refresh for the old server in flight across an identity change, and it fails without the fix. CI passed on the previous head,efb5a0acb.Shared dev, against silo-server#1709 at
51953b6c1(settings revision 17). This PR's debug builds ran on Android 16 phone and TV emulators, signed in as a throwaway account:Not shown live:
WatchPartySpoilersTestcovers the shared rule.Unit tests cover both.
Captures predate the babysit commits (
9478b55f6through917bf6189); they still hold. On shared dev, Andor S1E02's detail reportsbackdrop_is_episode_still: falsefor its series backdrop, so the TV marquee and detail heroes show the same artwork under the provenance check. The other changes are failure-path, race, and shuffle fixes that the captures don't reach.Fixtures: the settings and API v2 fixtures match silo-server
51953b6c1byte for byte, andSettingKeys.ktis regenerated from that manifest.Earlier rounds:
e559c5ffepassed 4,955 tests, including cases for Room persistence and migration, legacy downloads, unwatched reset, grouped artwork, launcher replacement, and remote watch-state precedence.eae8f4fb4added regression tests for the refused spoiler-key read, the failed series lookup, and legacy resume rows; each fails without its fix.Not verified: related human validation cases remain Not run. API 30 and earlier (ThumbHash fallback), physical TVs, tablets, and a full playback session are unverified.
Evidence: https://evidence.siloserver.org/r/silo-android/pr-427/
Risks and follow-ups
51953b6c1. If its merged commit changes the settings manifest or the API v2 fixtures, re-vendor both SOURCE records from that commit. A server that reaches the gating revision without the keys answers 404 and is treated as unsupported.maintoo): Android TV Watch Party shows a staged title the catalog refuses as available, where phone shows the unavailable notice. Fix after this PR.maintoo): two failed watched toggles on a grid card can leave it marked watched, which with image protection on also unblurs the still. Fix after this PR.Note
Add per-profile settings to hide spoilers for unwatched episodes
EpisodeSpoilerspolicy classifies episodes as unwatched and hides episode-still artwork and synopses across browse rows, grids, detail screens, next-up overlays, TV marquee, and downloads (EpisodeSpoilers.kt)SpoilerImage, which blurs on API 31+ and falls back to thumbhash or fallback art on older devices; hidden artwork is also removed from hero handoffs and Watch Next tiles (SpoilerImage.kt)watchedUpdatedAtMs/positionUpdatedAtMsand download columns default to null);withWatched/withPlayednow clear resume position and in-progress state; user-state writes record watched/position field timestamps, and delayed watched acknowledgements no longer clear resume position written at or after the admitted timestamp. Enabling image protection once invalidates existing Watch Next tiles.Macroscope summarized efb5a0a.
AI Disclosure
claude-opus-5-5(original implementation);gpt-6.1-sol(review and repairs).e559c5ffe:claude-opus-5-5(Claude Code in T3 Code) with Claude review subagents and a read-onlygpt-6.1-sol(Codex in T3 Code) second opinion;claude-opus-5-5wrote fixes07c384d9athrougheae8f4fb4.claude-opus-5-5(Claude Code in T3 Code) verified the review-bot threads onefb5a0acband wrote9478b55f6through917bf6189.