Repository navigation
feat(artwork): upload posters, backdrops and logos as local artwork - #3088
Conversation
Edit metadata > Images now has an Upload button on each tab. A movie or
series takes a poster, backdrop or logo, and a season takes a poster.
The upload goes through POST /api/v2/admin/items/{id}/images/upload, a
multipart form with the slot and a JPEG, PNG or WebP file of at most
10 MiB. Silo never writes into library folders, which are mounted
read-only, so the image is stored in artwork storage under the item's
local/ keys and published like an applied image, with the images lock.
Its source is upload://sha256:<hex>, a scheme image caching, reconcile
and the ladder backfill already treat as not downloadable.
The image list offers the upload as a local choice, marked current,
while the item shows it. Applying another image replaces it, and revision
GC collects it like any displaced revision, so no new table is needed.
Huma validates multipart text fields at form.<name>; problems now report
them under body.<name>, as they already did for file parts.
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:
|
|
Visible change; evidence is incomplete. The Evidence section names the surface and builds, but “the link follows shortly” provides no evidence URL or attached captures.
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Merge Risk:
|
- The Images tab toasts a validation problem's field detail, such as "The file is not a JPEG, PNG or WebP image", for both upload and apply, instead of the generic "did not pass validation" summary. - When publishing fails, the handler no longer queues for cleanup a revision the target already shows (a re-applied upload, or the same bytes uploaded again). The collector would have kept it anyway, since it checks references, but it no longer has to. - The handler takes its artwork publisher as an interface, so the upload and re-apply tests now check what gets published: the upload:// source, the images lock, and a season published with its series as parent.
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:
|
|
Please add C2 for both manual-metadata tasks, and Series admin C2, to the Suggested line: I could not read validation issues in Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
The image list resolved each shown upload's stored path with its own lookup after already batch-resolving the provider choices. It now adds the stored paths to that batch.
…uest When publishing a chosen or uploaded image failed because the request was cancelled, the cleanup call inherited the cancelled context. It now runs on a detached context bounded to 30 seconds.
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:
|
Regression
Major changes
The task issues' Use this corrected line:
I could not inspect validation tasks in Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a6b41f53-aa6b-46a9-a058-d772d22ec722
Files selected for processing: 22-
contracts/api/v2/openapi.jsondocs/admin-catalog-api.mddocs/architecture/local-nfo-metadata.mdinternal/api/handlers/admin_images.gointernal/api/handlers/admin_images_local_test.gointernal/api/handlers/admin_images_service_test.gointernal/api/handlers/admin_images_test.gointernal/api/handlers/admin_images_upload_test.gointernal/apiv2/admin_catalog_images.gointernal/apiv2/admin_catalog_images_test.gointernal/apiv2/problem.gointernal/contractledger/ledger_test.gointernal/metadata/uploaded_artwork.gointernal/metadata/uploaded_artwork_test.goweb/src/api/v2/adminImages.test.tsweb/src/api/v2/adminImages.tsweb/src/api/v2/operations.tsweb/src/api/v2/schema.tsweb/src/components/ImageSelectorTab.test.tsxweb/src/components/ImageSelectorTab.tsxweb/src/hooks/queries/items.test.tsweb/src/hooks/queries/items.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
Group the huma import with third-party packages, reword comments and test messages the spelling linter flags, and record the new upload route in the media route manifest.
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:
|
A browser that cannot name a file's type, such as a JPEG saved without an extension, sends it as application/octet-stream. The web check refused it and so did the form's part type, although the server checks the image's bytes. Both now let it through to that check. The handler also closes the uploaded part.
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:
|
The contract diff refuses approvals that match no change. Against current main, the two section-override approvals from Silo-Server#3050 match nothing, so the check fails for any branch from main until they are removed.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Enforce the image limit at multipart ingress. · admin_catalog_images.go:45-51
internal/apiv2/admin_catalog_images.go:45-51
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick winEnforce the image limit at multipart ingress.
The upload operation declares only an 11 MiB total limit. An image larger than 10 MiB can therefore be parsed or spooled before the handler rejects it. Enforce a 10 MiB per-part limit in the multipart gate before Huma parses the form. Keep the handler checks as defense in depth.
A form-field declaration alone is not sufficient because Huma v2.38.0's
FormFileprovides file metadata after multipart parsing, not a streaming per-part limit.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
08e896a5-ae05-4ec2-a28d-f8e5d140b2e2
Files selected for processing: 12-
contracts/api/v2/breaking-approvals.jsoncontracts/api/v2/openapi.jsondocs/admin-catalog-api.mdinternal/api/handlers/admin_images.gointernal/api/handlers/admin_images_upload_test.gointernal/api/testdata/media_routes.txtinternal/apiv2/admin_catalog_images.gointernal/apiv2/admin_catalog_images_test.gointernal/metadata/uploaded_artwork_test.goweb/src/api/v2/schema.tsweb/src/components/ImageSelectorTab.test.tsxweb/src/components/ImageSelectorTab.tsx
Files skipped from review as they are similar to previous changes: 3-
- internal/metadata/uploaded_artwork_test.go
- internal/api/handlers/admin_images_upload_test.go
- internal/api/handlers/admin_images.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
-
Finish the image part's description: an application/octet-stream part is accepted when its bytes are a JPEG, PNG or WebP image.
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:
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Classify large damaged JPEG/PNG uploads as unsupported images. · uploaded_artwork.go:82-86
internal/metadata/uploaded_artwork.go:82-86
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winClassify large damaged JPEG/PNG uploads as unsupported images.
A JPEG or PNG with a valid header, damaged pixel data, and more than 4,000,000 pixels can pass
PixelDataUndecodable, then fail during caching with a generic error. The upload handler then returns 500, while the documented v2 response is a validation error (422).Propagate a distinct pixel-data decode error from the image-cache layer and map that error to
ErrUnsupportedUploadedImageat this boundary. Do not map every cache error, because storage failures must remain server errors.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
54448ecf-048b-4aec-8147-b03eb6884b53
Files selected for processing: 3-
contracts/api/v2/openapi.jsoninternal/apiv2/admin_catalog_images.goweb/src/api/v2/schema.ts
Files skipped from review as they are similar to previous changes: 2-
- internal/apiv2/admin_catalog_images.go
- web/src/api/v2/schema.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
-
A reconcile that finds most of storage missing resets cached artwork without checking each object, and clears every row whose source isn't a provider URL. That cleared uploaded images whose objects survived, and nothing can fetch an upload again. Bulk mode now leaves upload:// rows out of the blind clear and verifies each one, clearing it only when its object is gone, as it already does for collection uploads. 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:
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Maintainer review summaryReviewed head: efa2f73. That is my two fix commits on top of the author's d7b3161, a merge of main (which brings in #2254), and three doc wording fixes from CodeRabbit. Fit: 8/10 · Readiness: 8/10 — conditional Fit. Edit Metadata had no way to use your own artwork when no provider or sidecar file has it, and most installs mount media read-only, so a sidecar file isn't an option. The PR reuses what already exists: the Readiness. The one verified defect is fixed on this branch and covered by a database test that fails without the fix. The upload flow itself is shown by the author's captures and covered by focused tests. I haven't exercised it live on the new head, and the open points below are for maintainers to settle. Addressed
Left for maintainers
Checks
|
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:
|
There was a problem hiding this comment.
Actionable comments posted: 3

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
220d6be4-aa06-46f5-a3be-f8a1648e03a2
Files selected for processing: 8-
contracts/api/v2/openapi.jsondocs/admin-catalog-api.mdinternal/api/handlers/admin_images.gointernal/api/testdata/media_routes.txtinternal/contractledger/ledger_test.goscripts/ci/db-contracts.txtweb/src/api/v2/operations.tsweb/src/api/v2/schema.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.
-
…d returns 500 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:
|
Problem
Related issue: #1209
Validation tasks: none. No passed case is affected. #1210 C1–C2, #1211 C1–C2 and #1251 C2 cover this picker and its images lock but haven't been run yet; the validator can include an upload when they are.
Edit Metadata > Images only offers what the metadata providers and the sidecar files beside the media supply. When none of them has the poster, backdrop or logo you want, there's no way to use your own image short of writing a file into the media folder, and most installs mount media read-only. This adds an Upload button to the Images tab. The uploaded image becomes the item's image straight away and is listed under LOCAL as the current choice.
Approach
POST /api/v2/admin/items/{id}/images/upload: acting admin, demo-restricted, non-retryable like apply. It takes a multipart form withtype(poster,backdroporlogo) andimage(JPEG, PNG or WebP, at most 10 MiB). The bytes decide the format, not the part's declared type. Movies and series take all three types and seasons take a poster. There's no v1 route.local/...keys with a digest discriminator, the same layout as a cached sidecar, andPublishArtworkSelectionpublishes it with the images lock like any applied image. Its source isupload://sha256:<hex>, a scheme that image caching, artwork reconcile and the ladder backfill already treat as not downloadable.localchoice while the item shows it, and apply takes thatupload://source back only when it matches what the item shows. Applying another image displaces the upload, and revision GC collects it after the grace period. So there's no new table, and nothing extra for content ID moves or GC reference checks to track. Keeping every upload as a pickable choice would need that table; I left it out.upload://row and clears it only when the object is gone, as it already does for collection uploads.publishItemImage, which includes the home-rail eviction fix(metadata): keep manual metadata edits through refresh and show them in home rails #2254 added, so an upload refreshes cached home rows as an applied image does.form.<name>, which the problem location grammar rejects.validationLocationnow reports them underbody.<name>, as it already did for file parts. That applies to any multipart text field Huma validates, not only this one.docs/admin-catalog-api.mdand the admin image picker section ofdocs/architecture/local-nfo-metadata.md. The user manual update is docs: cover uploading your own artwork in Edit Metadata siloserver.org#303.Validation
internal/metadata,internal/api/handlersandinternal/apiv2, and so do the wholeinternal/apiv2,internal/contractspecandinternal/contractledgerpackages, the contract fixtures and the scenario catalogue gate.TestArtworkReconcileBulkResetVerifiesUploadsDB(inscripts/ci/db-contracts.txt) checks that a bulk reset keeps a surviving upload and clears a lost one. It fails without the reconcile change.src/api/v2tests pass, as dotscand ESLint and Prettier on the changed files.verify-size-ratchet,verify-local-paths,verify-case-collisionsandverify-v1-route-freeze(against upstreammain) pass.verify-bididoesn't run with macOS git, so I checked the changed files for bidi characters separately.upload://sources and the images lock in the database.make lint-changedand the DB-backed jobs. CI runs those.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3088/
Surface and build: web admin, Edit Metadata > Images, at 1280 px and 390 px wide. Before:
6de6d5e5e(upstreammain). After:376020846(later commits change tests and error messages, not this screen). Both use the same local test library and item: a generated video with a generated sidecar poster, and generated upload images.Risks
form.<name>tobody.<name>change moves the error location in validation problems for multipart text fields. Theinternal/apiv2tests and contract fixtures pass unchanged.Checklist
AI Disclosure
upload://sources, lock and GC behaviour, theproblem.gochange, the web flow and test strength. It found that the handler tests never reached a successful publish, that upload errors showed only the generic validation summary, and that a failed re-publish queued the shown revision for cleanup. All three are fixed: the tests now check the published source, lock and season parent, the toast shows the field detail, and cleanup skips the shown revision. It also noted the damaged-large-image 500 listed under Risks, and an unbounded fallback decode inimageutilthat predates this change and also applies to collection uploads; this PR doesn't change it.AI-assisted with Claude Opus. I directed the task and designed the work.
Note
Add admin upload of poster, backdrop, and logo artwork
POST /api/v2/admin/items/{id}/images/upload, which accepts JPEG, PNG, or WebP files up to 10 MiB, caches them under local artwork keys with a SHA-256 digest source, and publishes them to the target. Movies and series support poster, backdrop, and logo; seasons support posters only. See admin_catalog_images.go and uploaded_artwork.go.upload://sources. See ImageSelectorTab.tsx and items.ts.upload://source republishes the currently shown image; other upload sources are rejected. Bulk artwork resets now skip uploaded-source rows in the bulk clear and sweep them per-row instead, preserving uploads that still exist in storage. See artwork_reconcile.go.bulkResetSurfaceclears uploads whose stored object is missing but keeps surviving uploads; the v1 API does not accept uploads; multipart validation errors now report underbodyinstead offormin problem.go.Macroscope summarized efa2f73.