Repository navigation
feat(api): include poster URLs in personal smart previews - #1892
Conversation
The Smart collection editor shows a live poster strip as the rules change, but /api/v2 previewCollection returned only ids, titles and types, so a client had to fetch each title again for its artwork. previewAdminCollection already carries poster_url. Each preview item now carries an optional poster_url, signed in one batch through the catalog detail service (the collection artwork resolver signs only stored collection artwork). Only titles the profile can see are signed. The shared handler view holds the URL as json:"-", so the frozen /api/v1 preview body is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The shared preview service signed every item's poster, but /api/v1 drops the URL from its body, so each v1 preview paid for a presign batch (possibly a plugin round trip) for no output. The request now carries WithPosters, which only the /api/v2 adapter sets and which a v1 body cannot set. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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: 6863fbeb0f
ℹ️ 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".
| ContentID ID `json:"content_id"` | ||
| Title string `json:"title"` | ||
| Type string `json:"type"` | ||
| PosterURL string `json:"poster_url,omitempty" doc:"Card-size poster URL; omitted when the item has none"` |
There was a problem hiding this comment.
Advertise preview posters in collection capabilities
When a client connects to an older server, an unsupported preview and a supported preview whose items lack artwork both omit poster_url, so the client cannot determine whether poster previews are available without inspecting the server version or contract digest. Add a preview_posters flag (or equivalent) to getCollectionCapabilities and document it for clients before exposing this field.
AGENTS.md reference: AGENTS.md:L149-L150
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 4db0cdf: getCollectionCapabilities now reports preview_posters: true (false when the collection service is not configured), and docs/catalog-api.md tells clients to check it rather than infer support from a missing poster_url. TestGetCollectionCapabilities covers the flag; the OpenAPI document, fixtures and web types are regenerated.
|
Major change — #193 S3 (Server/API, build 927 · The recorded S4 coverage concerns saved smart-collection membership and empty results ( Suggested fix: replace the PR body line with Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
A preview item without poster_url looks the same on a server that does not return posters and on one whose titles lack artwork. The preview_posters flag lets a client decide whether to draw a poster strip without sniffing the server version. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Updated the PR body: the validation line is now |
…view-posters Brings in login-wide personal collection sharing (#1875), the scrobble lock fix (#1887), and the earlier phase-1 merges from feat/collections-revamp. Capabilities now advertise both login_sharing and preview_posters, the fixture deps carry the shared collection alongside the preview view, and the preview fixture case stays appended after the create-description cases. Generated contract artifacts were regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Problem
Related issue: #192
Validation tasks: changes #193 S3
S3 changes because the v2 preview now returns poster URLs, a new kind of output on an access-checked response. Posters are signed only for the titles the access-filtered preview already returns, so a restricted title still can't be reached through the preview. S3 should be re-checked after merge to confirm no poster URL appears for a title the profile can't see. S4 is not affected: this changes only the unsaved
POST /api/v2/collections/previewresponse, not saved smart collection members or empty results.Stacked on #1888 (
feat/api-personal-create-description).A personal smart collection preview returns no posters.
POST /api/v2/collections/previewgives each matching title only its id, title and type, so a client can't show what the rules pick without fetching every title. The redesigned smart collection page shows a live poster strip that updates as the rules change. The admin preview,previewAdminCollection, already returns aposter_urlfor each item.This adds the same optional
poster_urlto personal preview items.Approach
PersonalCollectionPreviewItemgets an optionalposter_url, a card-size poster URL. It is left out when the title has no poster, the same as onAdminCollectionPreviewItem./api/v1/collections/preview. Both new fields (the item's poster and a request flag that asks for posters) are taggedjson:"-", and only the v2 adapter sets the flag. The v1 response bytes are unchanged, and a v1 request does no poster signing.getCollectionCapabilitiesgainspreview_posters. A missingposter_urllooks the same on a server that doesn't return posters and on one whose titles have no artwork, so a client checks the flag before drawing a poster strip. Clients that don't know either field ignore it.docs/catalog-api.mddocuments the field and the flag next to the other personal collection notes.preview_collection_okfixture is added at the end of the fixture list, so no existing request id changes.No web code reads the field yet; the smart collection page uses it in a later PR. jellycompat needs no change, since BoxSets read stored collections. The user manual doesn't describe API fields, and
silo-appleandsilo-androidneed no follow-up.Validation
make lint-changedagainstfeat/api-personal-create-descriptionare clean.make test-gopasses.handlers, the fullapiv2package, andusercollections. They cover these cases:poster_url.poster_url.poster_url.getCollectionCapabilitiesreportspreview_posters: true.verify-apiv2-openapi,verify-apiv2-contract(additive changes only: an optional preview property and the new capability flag),verify-apiv2-fixtures,verify-apiv2-web-types,verify-route-inventory,verify-migration-ledgerandTestCommittedArtifactMatchesRouterpass. So doverify-settings-bindings-all,verify-playback-fixtures,verify-scenario-catalogsandverify-offline-routes.tsc -bandmake test-webpass.make verify-local-pathspasses.internal/catalogfailsTestOrphanCleanupAfterPlexTableDropPostgres, because its fixture inserts a user without a role. This branch doesn't change that package or any migration.Risks
/api/v1requests and responses are unchanged.limitposters (100 at most). With a plugin image resolver, that can be one extra round trip per preview.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add optional
poster_urlto personal smart preview items in the v2 APIposter_urlfield toPersonalCollectionPreviewItemand a requiredpreview_postersboolean toCollectionCapabilitiesin the v2 contract (openapi.json).CollectionHandler.PreviewPersonalCollectionaccepts an internalWithPostersflag, batch-signs poster paths via a newItemPostersdependency (poster/small size), and copies URLs into the preview view. The router wires the catalog detail service as the signer.poster_url; the v1 preview response is unchanged.get_system_info_ok.jsonand index.json ETags.Macroscope summarized c22af4f.