Repository navigation
fix(jellycompat): serve profile avatars to Jellyfin apps and Seerr - #2685
Conversation
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:
|
|
Evidence is incomplete:
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
The API excerpts show the tag, ID format and image response changing, but don't show the uploaded avatar rendering in a client; Seerr also wasn't run. Please add before-and-after captures of the same profile in an affected Jellyfin app and Seerr, with the builds identified, as CONTRIBUTING.md's “Show visible changes” section requires. |
|
Suggested fix: Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
5585933 to
683806d
Compare
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:
|
|
Evidence is incomplete for one visible behavior:
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
Review summaryReviewed head: This round. No new defects at
No code main added since the old base emits a user ID to clients or compares a client's user ID in the old form. The remaining dashed Checked on Earlier round (
Maintainer decisions and remaining notes:
Validated features: the board could not be read, but #1246’s October 23 comment records C1 client smoke results and a C3 documentation gap. The result table is stale. The dashless user-ID contract and avatar behavior require repeating C1’s client matrix after merge; C3 needs checking against the server and the already-merged guide updates (#254 and #295 in siloserver.org). Keep User manual: covered by Silo-Server/siloserver.org#254 (merged; see above). Apple and Android: the native apps use Evidence: the captures were taken on Cross-provider review: gpt-6.1-sol (xhigh), two rounds. The first, on Fit: 8/10 · Readiness: 8/10 — conditional: CI green, migration costs accepted
🤖 Claude Code in T3 Code (claude-opus-5-5) Coordinator check: required CI passes on 🤖 Validation follow-up by Codex in T3 Code ( Decisions recorded by 🤖 Codex (gpt-6-astra) in T3 Code. |
Jellyfin users report a PrimaryImageTag when their profile has an uploaded
avatar, and /UserImage and /Users/{id}/Images/Primary serve it anonymously,
resolving the pseudo-user id through the stored compat sessions so any
replica answers. Users without an uploaded avatar get 404, as in Jellyfin,
instead of a placeholder square.
User ids are now sent as 32 lowercase hex digits, the way Jellyfin
serializes a Guid, which Seerr's avatar proxy requires. Routes and queries
still accept the dashed form clients stored earlier. Item, library and
server ids are unchanged.
Closes Silo-Server#2471
Closes Silo-Server#1903
The anonymous avatar routes found the profile through any unexpired compat session row, so signing out the login session behind it kept the avatar public until the row was next looked up. The owner lookup now rechecks each candidate session's login session, as a token lookup does. Each avatar request reads the session, profile, and blob stores, so the avatar routes now spend the per-IP rate-limit budget. The router check for /UserImage asserts the handler's 404 body, so it fails if the route is dropped, and a test that repeated isPseudoUser coverage is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
683806d to
6fdf9e1
Compare
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:
|
|
Major change — #1246 C1 needs re-validation after merge. The Oct. 23 issue comment records the real-client smoke matrix on server Major change — #1246 C3 needs re-validation after merge. The Oct. 23 note identifies the published-boundary gap tracked by #1246 C2 does not need to be added to the task line: Suggested fix: No diff. Keep Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
Problem
Closes #2471
Closes #1903
Related issue: N/A
Validation tasks: changes #1246 C1, C3
Jellyfin apps and Seerr never show a Silo user's profile picture. The user object leaves
PrimaryImageTagempty, so apps don't ask for an image, and/Users/{id}/Images/Primaryreturns a placeholder square instead of the uploaded avatar. Seerr also rejects every Silo user ID before it fetches anything: its avatar proxy accepts only 32 hex digits, and Silo sends user IDs with dashes.This change serves a profile's uploaded avatar to Jellyfin apps and Seerr, and sends user IDs the way Jellyfin does.
Approach
PrimaryImageTagwhen the profile has an uploaded avatar./UserImageand/Users/{id}/Images/Primaryare anonymous, as in Jellyfin, and return the 256px WebP, or 404 when there is no uploaded avatar. Preset avatars are SVGs most Jellyfin apps can't draw, so they get no tag and a 404.jellycompat_sessions.pseudo_user_idbacks that lookup. A user with no live compat session gets 404, and a compat session whose login session was signed out or expired doesn't count as live. The avatar routes spend the per-IP rate-limit budget, since each request reads the session, profile and blob stores; item artwork stays exempt./Sessions,SessionInfo.UserIdandUserDataChangedmessages. Routes and queries still accept the dashed form that apps saved before. Item, library and server IDs keep their dashes.docs/jellycompat-api.mdrecords the ID format and the avatar routes.Validation
Validation impact: Compatibility layers (Jellyfin / Audiobookshelf) — Jellyfin compatibility #1246’s October 23 comment records C1’s client smoke results on server
31fabc723plus fix(jellycompat): report hls sub-protocol only for sources played via TranscodingUrl #2934/fix(jellycompat): serve GET /Library/MediaFolders for library discovery #2935/fix(jellycompat): accept an empty stream index in playback requests #2970. This PR changes the sign-in/user ID contract to Jellyfin’s dashless Guid form, which Seerr requires, and adds avatar discovery and lookup. That is a major change to the exercised contract: after merge, repeat C1 with Jellyfin Web 12.1, Findroid 1.1.0 and Jellyfin for Android TV 0.19.10, recording server and client builds. Recheck C3 against the published compatibility guide, including uploaded/preset avatars and the Seerr relink instructions. The guide updates in siloserver.org#254 and .strm Files Not Working as Media #295 are merged; that alone is not a new validation result. C2’s profile/item restrictions and acceptance of both UUID forms are unchanged.Go:
go build,gofmt,go vet,make lint-changedandmake lint-router-recoverypass.make test-gopasses except two Dolby Vision strip tests ininternal/jellycompat, which fail the same way on the base build on this machine (its local ffmpeg) while CI passes them on that commit.verify-*targets: route inventory, migration ledger, migrations, scenario catalogs, offline routes, apiv2 OpenAPI/contract/fixtures, playback fixtures, v1 route freeze, local paths, case collisions, size ratchet and bidi pass.verify-settings-bindings-alldid not run its web half (web tooling isn't installed here); this branch changes no settings or web files.make test-db-pinsagainst a fresh migrated pgvector database: the new cross-replica owner lookup test passes. Two full runs each had one different failure in an untouched package (internal/metadata, theninternal/userstore/pgstore), caused by tests sharing the database. Both tests pass when run alone, on this branch and on the base, five times each.After rebasing onto main at
81ae2ce1c(head6fdf9e1):go vet,make lint-changed,make lint-router-recovery, the migration, route inventory, local path and case collision checks, thejellycompat,userstoreandapi/handlerstests, and everyjellycompattest inscripts/ci/db-contracts.txtagainst a freshly migrated Postgres pass. The end-to-end captures below were taken before the rebase; the rebase doesn't change the avatar code.End to end on a local server, base build (
365e3d436) and this branch on the same database: the excerpts below. Jellyfin Web 12.1 and Seerr 3.5.0 were run against both builds; see Evidence.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-2685/
The page shows before-and-after captures of the same profile with an uploaded avatar, desktop and phone width, in Jellyfin Web 12.1 (home header, user menu, profile page) and Seerr 3.5.0 (user list, profile). Before is
365e3d436, after is558593396. It also has before-and-after excerpts of the sign-inSessionInfo.UserId,/Users/Me,/UserImage,/Sessionsand theUserDataChangedsocket message. Seerr's first-run wizard needs a Jellyfin administrator and/Auth/Keys, which Silo doesn't provide, so a local proxy completed only that step; the captures and avatar requests went straight to Silo.Surface: Jellyfin-compatible API, the user object and avatar route that Jellyfin apps and Seerr render. Admin profile with an uploaded 914-byte PNG avatar. Before:
365e3d436. After: this branch.Risks
The maintainer accepts the one-time Seerr relink and fresh Jellyfin Web sign-in described below. Avatar requests remain under the per-IP rate limit because each request reads the database and blob store.
UserDataChangedevents with that ID, so watched and progress changes from other devices stop updating that page live until the user signs in again. Routes, playback and saving state still work.Checklist
AI Disclosure
Decision follow-up: Codex in T3 Code (
gpt-6-astra) recorded acceptance of the migration costs and the avatar rate limit.Validation follow-up: Codex in T3 Code (
gpt-6-astra) checked the task comments and corrected the recorded-results and re-validation notes.Harness: Claude Code in T3 Code
Tool(s): Claude Code; Codex CLI (review only)
Model(s): claude-opus-5-5; gpt-6.1-sol (review only)
Involvement: Fully AI-generated, human verified
Adversarial review: two independent reviews of the branch diff (claude-opus-5-5 and gpt-6.1-sol, medium effort). GPT found nothing. Opus found that Jellyfin web sessions from before the update stop matching
UserDataChangedevents (confirmed in jellyfin-web's item details page and listed under Risks) and that a user with no live compat session gets a 404 avatar (by design, documented indocs/jellycompat-api.mdand in the user manual).Note
Serve uploaded profile avatars to Jellyfin apps and Seerr via user-image routes
ImagesHandler.HandleUserImagewith a real avatar loader (compatUserAvatarsin user_avatar.go) that maps a pseudo-user UUID to a compat session, loads the profile, and serves the uploaded avatar blob. Missing avatars return JSON 404; storage errors return 503; bodies over 2 MiB are rejected. Served avatars use public 1-hour cache control.SessionInfo, sessions,UserDataChangedsocket messages) as dashless lowercase hex viacompatUserID. User-ID checks accept both dashed and dashless forms throughisPseudoUser.PrimaryImageTagto user DTOs, derived from the avatar display key and profileUpdatedAt.SessionStore.PseudoUserOwnerfor mapping a pseudo-user UUID back to its account/profile, backed by a newPseudoUserTokensrepository query and apseudo_user_idindex (migration)./UserImageand/Users/{id}/Images/Primaryroutes now pass through the per-IP rate limiter instead of being unauthenticated without it; the image-proxy middleware no longer rewrites/Usersobject responses.Macroscope summarized 6fdf9e1.