Repository navigation
feat(access): limit a profile by advisory age - #1429
Conversation
Household managers could restrict a profile by content rating only. The advisory age from #1417 (Common Sense Media's "13+", or MDBList's own estimate) was a badge, although it separates titles that one rating tier lumps together, which is how many parents already decide. A profile now carries max_advisory_age (1..21, null for none). A title is hidden when its advisory age is above the limit, ANDed with the content-rating ceiling. A title with no advisory age is never hidden by it: coverage comes from a rate-limited provider, so a missing age means "not fetched yet", and the ceiling alone decides it. The limit can only tighten what a profile sees, never widen it. Enforcement goes through the one SQL point the ceiling already uses, renamed ApplyMaturityLimits. The ceiling, the unrated-content flag and the new limit now travel as one access.MaturityLimits value, embedded in access.Scope and every catalog filter. The ~25 sites that rebuild a narrowed filter copy it whole, so a later limit cannot be dropped the way the unrated flag once was. episode_catalog_entries gains advisory_age, maintained by the series trigger, so episode listings apply the limit too. Profile storage (Postgres and SQLite), the scope policy (Rego, with an override that can only lower the limit), both resolvers, cache keys and the cursor digest carry it. Changing it bumps access_policy_revision like the ceiling does. /api/v1 is frozen, so the field rides the shared structs with json:"-"; /api/v2 profiles expose it with max_advisory_age_supported as the feature flag, and the admin dashboard stats report advisory_titles so an admin can see the coverage the limit acts on. The web profile editor gains the control and the docs drop the display-only wording. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Important Review skippedToo many files! This PR contains 137 files, which is 37 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (137)
You can disable this status message by setting the 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 |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61faddd4b7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… servers Review follow-ups on the advisory-age limit. Only movies and series carry an advisory age now: the plugin provider drops one reported for any other item type, so the profile limit can never hide an audiobook or ebook in the beta book libraries. The Audiobookshelf author list keeps its precomputed-count path when only an advisory limit is set, since that limit cannot hide a book. The web profile editor honors max_advisory_age_supported: it shows the control and sends max_advisory_age only when listProfiles reports the server supports it. An older server rejects unknown members, so a frontend pointed at one would otherwise fail every profile save. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95f05c58d0
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review follow-ups on the advisory-age limit. The migration clears advisory ages on rows that are not movies or series. The host now drops such ages on intake, but a refresh never clears a stored one, so an age a book picked up earlier would have kept it under the limit. The provider that supplies advisory ages only answers for movies and series, so this normally matches nothing. The web editor offers every limit the server accepts, 1 through 21, so a profile set to any valid limit by another client opens on a matching option. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19fd631da2
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A catalog-bundle import could still write an advisory age onto an audiobook or ebook row after the migration cleared them, which would bring the book back under a profile's advisory-age limit. models.AdvisoryColumns, the one function every advisory write goes through (item upserts and every catalog-bundle import path), now takes the item type and stores NULL for anything but a movie or series. The plugin provider uses the same models.AdvisoryAgeApplies rule. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Problem
A household manager can restrict a profile by content rating only. Rating tiers are coarse: PG-13 covers titles a 10-year-old can watch and titles that are close to an R. The advisory age from #1417 (Common Sense Media's "13+", or MDBList's own estimate) separates those titles. It is also how many parents already decide what a child may watch. Today Silo shows that age as a badge and ignores it for access.
Solution
A profile can carry
max_advisory_age, from 1 to 21, or null for no limit. Silo hides a title whose advisory age is above the limit.access.unrated_contentdoes not apply to the advisory limit.ApplyMaturityLimits), so it applies to browse, search, detail, episodes, sections, progress, recommendations and jellycompat.episode_catalog_entriesgainsadvisory_age, filled from the series by the refresh function and kept current by the series trigger. Episodes follow their series' advisory age.access_policy_revision, like the ceiling.One value for every maturity limit
The ceiling, the unrated-content flag and the new limit now travel as one
access.MaturityLimitsvalue. It is embedded inaccess.Scopeand in each catalog filter (AccessFilter,BrowseFilters,CalendarFilter,BrowseFavoritesFilters).About 25 call sites rebuild a narrowed filter. They now copy the whole value (
AccessFilter{MaturityLimits: f.MaturityLimits}) instead of listing fields. This touches many files, but a missed site became a compile error instead of a silently dropped limit, and a future limit cannot be dropped the same way.catalog_resolver.goalready records a past fix for exactly this bug, where a read kept the ceiling and dropped the unrated flag.FilterAccessibleContentIDstakes the value instead of a positional string and bool.Contract
json:"-", and a test checks that v1 bodies neither accept nor return it.Profile.max_advisory_ageis an integer or null.createProfiletakes it as optional, andupdateProfiletakes a Patch member where null clears it.listProfilesreturnsmax_advisory_age_supported. The profile operations reject unknown members, so clients must check the flag before sending the field.getAdminDashboardStatsreturnsadvisory_titles: the number of movies and series with an advisory age. The web dashboard can show it as an optional "Advisory ages" tile.catalog.show_advisory_agechanged: the badge setting still only controls display. The revision moved from 10 to 11, per settings-contract.md.max_advisory_age_supportedis true, so a frontend talking to an older server keeps saving profiles. The display-only wording is gone from the web and docs.Deploy effects
access.ScopeJSON only change for a profile that has a limit. In-flight cursors, socket tickets and progress snapshots survive the upgrade.advisory_age IS NULL OR advisory_age <= $nmatches nearly every row. The migration comment says so.Validation
FilterAccessibleContentIDs,EnsureAccessibleandEnsureAccessibleIDs, browse and genres,BrowseEpisodes, mixed search, and theepisode_catalog_entriesread model. It also checks that a series advisory change reaches its episodes, and that the limit ANDs with the ceiling. A relation missing the column only fails once a limit is set, which is why the test runs every read with one.MaturityLimitsfield changes the cache key;make test-db-pinspass.Risks
advisory_titlesshows how much of the library the limit acts on.Follow-up
max_advisory_age_supported, andmake apiv2-fixtures-syncfor the new profile fixtures.Related issue: N/A
Validation tasks: reaches #1180 C2, #1181 C1 and C4, #1250 C4, #1246 C2. Profiles without a limit behave as before; this adds a restriction and changes no passed case.
AI disclosure
Written by Claude Opus 5.5 (model identifier
claude-opus-5-5[1m]) running in Claude Code as the agent harness, driven interactively by the maintainer. Claude Code subagents on the same model were used for code search and planning. No other AI tooling was used. The maintainer chose to enforce the advisory age, to count both advisory sources, and to keep the limit tighten-only with no hiding of titles that have no advisory age.🤖 Generated with Claude Code