Repository navigation
feat(catalog): include per-episode overlay summaries on season episode listings - #364
Conversation
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13322d5c59
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| files := catalog.FilterMediaFilesByAccess(filesByEpisode[resp[i].ContentID], filter) | ||
| resp[i].Files = episodeFileResponses(files, filter) | ||
| resp[i].UserData = userData[resp[i].ContentID] | ||
| resp[i].OverlaySummary = overlays.BuildSummary(files) |
There was a problem hiding this comment.
Build overlays from fully access-filtered files
For viewers with library restrictions but no playback-quality ceiling, FilterMediaFilesByAccess returns the original slice without checking AllowedLibraryIDs/DisabledLibraryIDs, while episodeFileResponses still applies FileAllowedByAccess. In that scenario the new overlay_summary can be derived from an inaccessible episode file, e.g. showing a disabled-library 4K/HDR copy even though the files payload only exposes an allowed 1080p copy. Use the same fully filtered file set for both the response and BuildSummary.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed — FilterMediaFilesByAccess short-circuited on an empty quality ceiling and skipped the library-ID checks that FileAllowedByAccess enforces, and the same gap applied to the pre-existing browse/section overlay paths that use this helper. Fixed in 2736aa6 at the shared helper: it now short-circuits only when no access criteria are set at all, with unit tests covering library-restriction-only filters.
…e listings Episode cards already render user-configurable overlay badges everywhere except the series/season detail pages: the season-episodes endpoint never included overlay_summary, so SeasonEpisodeGrid and EpisodeRow had nothing to render. Server: add overlay_summary (omitempty) to episodeResponse and populate it in buildEpisodeResponses via overlays.BuildSummary over the episode's already-loaded media files, access-filtered with FilterMediaFilesByAccess to match the browse/sections paths. No extra queries; the files were already batch-fetched for the files[] payload. Additive-only API change. Web: extend EpisodeListItem with overlay_summary, add overlayDataFromEpisodeListItem (shared extract helper), and render CardOverlays (variant="wide") on the episode stills in SeasonEpisodeGrid and EpisodeRow using useOverlayPrefs, matching the ContinueWatchingCard pattern. The hook already honors the admin kill switch and per-user prefs. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…without a quality ceiling FilterMediaFilesByAccess short-circuited whenever MaxPlaybackQuality was empty, skipping the AllowedLibraryIDs/DisabledLibraryIDs checks that FileAllowedByAccess enforces. For viewers with library restrictions but no quality ceiling, callers (episode listings, browse/section overlay summaries, item detail versions) received files from restricted libraries. Short-circuit only when no access criteria are set at all. Co-Authored-By: Claude Opus 4.8 <[email protected]>
2736aa6 to
9430115
Compare
Problem
Card overlay badges (resolution, HDR, audio, codec, etc.) render on episode cards in browse grids, home sections, Continue Watching and Next Up — but the episode grid/list on series & season detail pages shows none. The season-episodes endpoint's
episodeResponsenever carriedoverlay_summary, andSeasonEpisodeGrid/EpisodeRownever renderedCardOverlays.Approach
Server: add
overlay_summary(omitempty) toepisodeResponseand build it inbuildEpisodeResponseswith the existingoverlays.BuildSummary()over the episode's already-batch-loaded media files, access-filtered withcatalog.FilterMediaFilesByAccessexactly like the browse/sections paths. No new DB queries. Like those endpoints, the summary is always included; the admin kill switch and per-user prefs are enforced client-side byuseOverlayPrefs.Web: extend
EpisodeListItem, addoverlayDataFromEpisodeListItemvia the shared extractor, and render<CardOverlays variant="wide">on episode stills inSeasonEpisodeGridandEpisodeRow, following theContinueWatchingCardpattern.API additivity
Additive-only per v1 API rules: one new optional
omitemptyfield on an existing response shape. Existing clients are unaffected.Risks
Low. Marginal response-size increase on season episode listings; overlay build is in-memory over files already fetched. Episode listing payloads lack rating/studio fields, so rating-type badges simply don't render there — the same graceful degradation the extractor already handles.
Verification
go build ./...,go test ./internal/api/... ./internal/overlays/...pass; ESLint/Prettier clean;EpisodeRowvitest suite passes.AI-use disclosure: implemented by Claude (Claude Code) under human direction and review.
🤖 Generated with Claude Code