Repository navigation
fix(collections): build generated collection posters from titles the viewer can access - #1702
Conversation
…viewer can access A server collection without an uploaded poster showed one 4-up collage, built from its first four members and served to every viewer, so a PG profile could see the posters of R-rated titles or of titles in libraries it can't access. Each viewer now sees a collage of the first members it can access, using the member list's access predicates. Collages are stored per distinct set of source posters in library_collection_poster_variants and shared by every viewer that selects the same posters. A missing collage is built in the background; syncs build the unrestricted one up front. Jellyfin BoxSets resolve the same collage, and their 32-hex image tag names it so tag-only image requests find it. library_collections.poster_url now holds only uploaded and template posters. The migration clears the old shared collages and queues their objects for the artwork revision collector. Closes #1618 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (25)
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 |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
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: 02fef349a9
ℹ️ 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".
Unused collages were deleted row first, then objects. A rebuild of the same collage between the two lost its objects under a live row, and a failed object delete orphaned them for good. Retiring a collage now deletes its row and queues its objects in artwork_revision_gc_candidates in one transaction. The collector waits out its grace period and skips a path that a rebuilt row names again, and it clears the row if it already deleted the objects, so the next read rebuilds the collage. A collage source whose URL doesn't resolve now fails the build like a failed download does, so a transient resolver failure is retried instead of storing an incomplete collage under the full key. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32311bf6ed
ℹ️ 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".
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dd2fe2063
ℹ️ 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".
…fore rebuilding Deleting a collection cascaded its collage rows and left their objects to a best-effort prefix delete after commit, so a storage failure orphaned them. A delete trigger on library_collection_poster_variants now queues a deleted row's objects for the artwork revision collector in the same transaction, covering both retirement and cascades. Collage paths are deterministic, so the collector could delete objects a rebuild was uploading before the rebuild saved the row that protects them. A build now first withdraws its path from the collector's queue, and waits for a later read when a collector worker holds the path. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7cf3aeb3b
ℹ️ 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".
|
The #1618 poster-leak cases are ready for re-test; this PR does not itself record validation. The access-filtered source query and viewer-resolved v1/v2 and Jellyfin BoxSet poster paths address the shared-collage finding. Re-run #193 S3/S6 and #195 W3/W5 on the merged build; the #193 S3 pass is from build 927 and predates the finding, and S6’s assigned-art result does not cover per-viewer generated collages. #1616’s cross-profile-ordering finding remains separate and is not changed here. Apple/Android Collections tasks #20/#21/#5/#6 and Web admin #194 have no recorded results to carry forward; native library-tab cards consume Suggested fix (no diff): keep the existing line: Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
…sted collections Withdrawing a collage path from the artwork collector before a build left the objects untracked if the build then failed, and a failed save or a partial upload orphaned whatever was written. A build now reserves its path in the collector's queue, pushing any earlier entry past the build, and saving the row releases the reservation in the same transaction. A build that fails or dies anywhere in between leaves its objects to the collector. The catalog lists a collection with a query definition from that query, whatever its type, so such a collection's collage could show titles its page doesn't. Collages now skip every collection the catalog treats as query-listed, not only smart ones. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Problem
Closes #1618
Related issue: #192
Validation tasks: unblocks #193 S3, #193 S6, #195 W3, #195 W5
A server collection without an uploaded poster shows a 4-up collage of its
members' posters. That collage was built once from the first four members and
shown to everyone, so a PG profile, or a profile without access to a library,
saw posters of titles it can't open. The collection's member list already
hides those titles. Every client and Jellyfin BoxSets showed the same image.
This change builds the collage from the first four members the viewer can
access, so the poster matches what the viewer sees when they open the
collection.
Approach
library allow and deny lists, maturity limits, and excluded media types.
Selection runs at read time in one batched query per list, so rating
corrections and policy changes apply without regenerating anything.
library_collection_poster_variants, keyed by a hash of those posters, andshared by every viewer that selects them. An unrestricted viewer gets the
same four posters as before, so admins see no change.
(clients show their title placeholder) and the collage is built in the
background. Builds are deduplicated per node and back off after a failure.
Nodes that build the same collage write the same objects. Syncs, template
bundle apply, and poster removal still build the unrestricted collage up
front. Building a collage deletes the collection's collages that nobody has
read for a week. A source poster that doesn't resolve or download fails the
build, so an incomplete collage is never stored.
collage table queues a deleted row's objects for the artwork revision
collector in the same transaction, which covers unused collages and those of
a deleted collection. Because collage paths are deterministic, a build first
reserves its path in that queue, and saving the row releases it in the same
transaction, so a build that fails or dies midway leaves its objects to the
collector. A build waits for a later read while a collector worker holds the
path.
library_collections.poster_urlnow holds only uploaded and templateposters. The migration clears the old shared collages and queues their
objects for the artwork revision collector. Collage rows are also an artwork
reconcile surface, so a storage change rebuilds them.
is 32 hex digits, its key followed by a signature, the same shape as a native
Jellyfin tag. That lets the tag-only image requests Jellyfin Web sends find
the right collage. Successful tagged image reads refresh collage usage at
most daily, so clients that retain collection lists keep their active collages.
poster_urlandposter_thumbhashon v1, v2, andjellycompat now differ by viewer. No collection list response is cached
across profiles: v1 sends no cache headers, v2 sends
no-store, and the webclient clears its query cache on profile switch.
Manual collections without a poster now get a collage too, and it follows
member changes. Before, a manual collection got one only after an admin removed
its poster. A collection the catalog lists from a query (smart collections, or
any collection with a query definition) still gets no collage (#903).
Validation
gofmt,go vet,make lint-changed,make test-go, and the Go contract, fixture, route, migration-ledger, scenario-catalog, offline-route, settings-binding, and local-path gates pass. The web gate was not run; no web files change.main, the same way, so they are baseline failures:TestOrphanCleanupAfterPlexTableDropPostgres,TestSyncMergeStepsAfterPlexTableDropPostgres,TestAdminSubtitleListPageDB, andTestCatalogTransferPersistsJobsAndSignedLink.TestRunLadderBackfillDrainsEachBatchAndCompletesalso reports the same data race onmainunder-race.Evidence: https://evidence.siloserver.org/r/silo-server/issue-1618/
Risks
poster_url. Newer nodes never serve it, but its objects stay in storage until the poster is replaced or the collection is deleted.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Build viewer-specific generated collection posters from accessible member titles
Replaces the single shared auto-generated collection poster with per-viewer collages built from member titles the viewer can access. Source selection applies item access predicates (visible library, maturity) and takes up to four member posters in collection order. Collages are stored per collection and keyed variant in a new
library_collection_poster_variantstable, built in the background with a bounded queue (256 pending, 2 concurrent, 10-minute retry backoff), and retired after 7 days unused.catalog.LibraryCollectionService.CollectionPostersserves assigned non-auto-generated posters first, then stored viewer collages, and schedules missing ones for async build. All API and admin collection responses now run through viewer poster selection (library_collections.go) instead of returning stored poster fields.PosterURL/auto-generated flag consumers and the removedLibraryCollectionRepository.ListItemPosterPathsandLibraryCollectionHandler.GenerateCollectionPostercall sites, since stored poster fields no longer reflect generated collages.Macroscope summarized d5d261e.