Repository navigation
feat(catalog): serve stored metadata and credits on the admin catalog listing - #3571
Conversation
… listing listAdminCatalogItems now returns each movie's and series' genres, content rating, studios, networks and the four stored ratings, and with include_people=true its cast and crew. Admin tools that match rules on metadata, such as library cleanup, can read a whole library in pages without acting as a profile. getAdminCatalogCapabilities reports item_metadata. Closes #3568 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
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. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
@Quick104 thanks, this covers the Maintainerr adapter’s genre, rating, studio and people rules. One addition that would save per-item detail reads: date fields on the rows. Maintainerr has rules on release date, “last episode aired”, and “season’s last episode aired”, and the listing only has |
Movie and series rows carry release_date, and series also first_air_date and last_air_date; episode rows carry air_date. Cleanup rules on release date and last aired episode no longer need a detail read per item. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Added in 946c1b7. Movie and series rows now carry For "last episode aired", use the series row's
🤖 Claude Code (claude-opus-5-5) |
Problem
Closes #3568
Related issue: N/A
Validation tasks: none
An admin tool can list every movie, series and episode through
GET /api/v2/admin/catalog/items, but it can't see genres, ratings, studios, release or air dates, or cast there. Those fields are only on the profile-scoped item detail. A cleanup tool such as a Maintainerr adapter, whose rules match on those fields, has to look up the key owner's primary profile and read every item as that profile: one request per item, filtered by that profile's restrictions.This change adds the stored metadata, including dates, to the admin listing rows, and the cast and crew when asked for, so a tool can read a whole library in pages without acting as a profile.
Approach
genres,content_rating,studios,networks, the four stored ratings (rating_imdb,rating_tmdb,rating_rt_critic,rating_rt_audience), andrelease_date; series rows also carryfirst_air_dateandlast_air_date. Dates use item detail'sYYYY-MM-DDform. These are the stored values: not localized and not narrowed by any profile. The listing serves every stored rating whether or not title pages show that source, as item detail already does for metadata curators. Episode rows carry only their ownair_date; tools read the rest from the series row named byseries_id, and a season's last air date is the latestair_dateamong its episode rows. They come from themedia_itemsrow the page query already reads, so a default page still runs two statements.include_people=trueaddscastandcrew, using the existingCastCreditandCrewCreditshapes from item detail without photos. Credits load in one more statement inside the page's read-only snapshot, so a page with credits runs three. They are off by default because they make a page several times larger. Like every listing filter,include_peopleis bound into the cursor.getAdminCatalogCapabilitiesreportsitem_metadataso tools can tell whether a server returns these fields.admin:monitor:readAPI-key scope, and tools can match titles to Radarr or Sonarr through the provider ids the listing already returns.docs/admin-catalog-api.mddocuments the fields, the opt-in credits, the statement budget, and one limit for mirrors: renaming or merging a person changes their credits on every item without acatalog.item.changedevent, so a mirror that keeps credits picks that up on its next full pass.This is an admin-only native route. Apple and Android have no callers, and Jellyfin clients read item metadata through their own item queries, so there's no client or jellycompat follow-up. The user manual doesn't describe admin API routes, so it needs no update.
The contract diff tool requires the next pull request that changes the v2 contract to prune approvals left by the last merged one, so this change empties
breaking-approvals.json(twolistAdminBackupsapprovals from #3402).Validation
item_metadata, andinclude_peopleanswered422.networks,first_air_dateandlast_air_date, and an episode row'sair_date, match their rows; episode rows carry none of the other new fields.admin:monitor:read, without a profile, gets200on the listing with and withoutinclude_people. It gets403on profile-scoped item detail and on catalog export. A cursor reused withinclude_peoplechanged answers400 invalid_cursor, and a request without credentials gets401.TestListAdminCatalogItemsDB(already indb-pins.txt) now also covers stored metadata and dates, including a zero Rotten Tomatoes score kept as a score; onlyair_dateon episodes; credits only on request; and two statements per page, or three with credits. It passes against a migrated Postgres. On main it does not compile, because the fields it checks don't exist there, so the live before and after is the proof.go build,go vet,gofmt,go mod tidy -diff, andmake lint-changedare clean. Thecatalogandapiv2package tests pass with a database at this head, and theapipackage tests passed at the first commit, which the date commit doesn't touch. OpenAPI, web types and fixtures are regenerated, andverify-apiv2-openapi,-web-types,-contract(16 additive changes),-fixtures, the committed-artifact test,verify-route-inventory,verify-local-pathsandverify-size-ratchetpass. Web lint and format checks pass. The fullmake test-goandmake test-websuites were not run locally.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/issue-3568/
No visible change in the apps, web app or web admin. The evidence page has the before and after API responses, the scoped-key results and the credit-volume measurements.
Risks
Additive fields, one query parameter and one capability on an admin-only
/api/v2operation. Once 1.0 locks the contract, these names are permanent.Credits are unbounded per item. On the test library an item averages about 40 credits, so a 200-item page with
include_peoplecarries roughly 8,000 credits, about 1 MB. A synthetic worst case of 200 items with 150 credits each (30,000 credits) read in 62 ms and serialized to about 4 MB. Tools can lowerlimitif pages get too large.Checklist
AI Disclosure
include_peopleinto the cursor. The attack's two findings became the documented credit-event limit and the measured page size above.plex_guidto the credits, which item detail already returns, simplified the credits loader, and fixed the docs wording on the statement budget. Its finding about the pruned approvals was answered with the contract tool's pruning rule.🤖 Generated with Claude Code
Note
Add stored metadata and cast/crew credits to admin catalog listing
include_peoplequery parameter to the admin catalog listing, reported via a newitem_metadatacapability. When set, the listing loads cast and crew throughattachAdminCatalogCreditsin admin_item_listing.go.AdminCatalogItemgains fields for genres, content rating, studios, networks, four stored ratings, and release/air dates. Movies and series get these from the page query; episodes get only an air date.contracts/api/v2/breaking-approvals.jsonempties the approvals list — check that no pending contract approvals depended on the prior entries.Macroscope summarized 946c1b7.