Repository navigation
fix(jellycompat): parse repeated Fields query params - #110
Conversation
parseItemsQuery read the Fields parameter via q.Get("Fields"), which
returns only the first value when a client sends Fields as repeated
query params (Fields=A&Fields=B&...) instead of comma-separated in a
single param (Fields=A,B,C).
The jellyfin-sdk-kotlin (used by Wholphin) sends repeated params. When
such a request listed a detail-only field like MediaSources after other
fields — e.g. the episode-playlist request
/Shows/{id}/Episodes?Fields=PrimaryImageAspectRatio&...&Fields=MediaSources&...
silo saw only the first value (PrimaryImageAspectRatio), so
needsDetailFields stayed false, the request took the list path, and the
response came back without MediaSources. Clients then could not start
playback of the returned episodes ("no media sources").
Join all repeated Fields values before splitting on commas so field
order and delimiter style no longer matter. Comma-separated single-param
clients (e.g. VidHub) are unaffected.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR implements three identified Jellyfin compatibility gaps and documents the full endpoint coverage analysis. Theme Songs stub endpoint returns empty results with OwnerID, query parameter parsing now handles repeated Fields values correctly, CanDownload is disabled to prevent 404 attempts, and coverage report records methodology and resolutions. ChangesJellycompat Endpoint Gaps and Correctness Fixes
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Wholphin (jellyfin-sdk-kotlin) audit surfaced two reachable gaps:
- mapping.go set CanDownload=true on every playable item while no
/Items/{id}/Download route exists, sending clients that honor the flag
(e.g. Wholphin's screensaver/slideshow) into 404s. Advertise false until
a download route exists.
- GET /Items/{id}/ThemeSongs 404'd, so enabling theme songs in Wholphin
silently failed on every detail page. Stub it with an empty
ThemeMediaResult. This cannot reuse the generic item stub: the SDK
models OwnerId as non-nullable, so the response must include it even
when empty.
Co-Authored-By: Claude Fable 5 <[email protected]>
Cross-references every Jellyfin endpoint the Wholphin client can call against the routes jellycompat serves, with gating evidence for each missing-but-unreachable endpoint and prioritized recommendations. Co-Authored-By: Claude Fable 5 <[email protected]>
* fix(jellycompat): parse repeated Fields query params
parseItemsQuery read the Fields parameter via q.Get("Fields"), which
returns only the first value when a client sends Fields as repeated
query params (Fields=A&Fields=B&...) instead of comma-separated in a
single param (Fields=A,B,C).
The jellyfin-sdk-kotlin (used by Wholphin) sends repeated params. When
such a request listed a detail-only field like MediaSources after other
fields — e.g. the episode-playlist request
/Shows/{id}/Episodes?Fields=PrimaryImageAspectRatio&...&Fields=MediaSources&...
silo saw only the first value (PrimaryImageAspectRatio), so
needsDetailFields stayed false, the request took the list path, and the
response came back without MediaSources. Clients then could not start
playback of the returned episodes ("no media sources").
Join all repeated Fields values before splitting on commas so field
order and delimiter style no longer matter. Comma-separated single-param
clients (e.g. VidHub) are unaffected.
* fix(jellycompat): stop advertising CanDownload and stub ThemeSongs
Wholphin (jellyfin-sdk-kotlin) audit surfaced two reachable gaps:
- mapping.go set CanDownload=true on every playable item while no
/Items/{id}/Download route exists, sending clients that honor the flag
(e.g. Wholphin's screensaver/slideshow) into 404s. Advertise false until
a download route exists.
- GET /Items/{id}/ThemeSongs 404'd, so enabling theme songs in Wholphin
silently failed on every detail page. Stub it with an empty
ThemeMediaResult. This cannot reuse the generic item stub: the SDK
models OwnerId as non-nullable, so the response must include it even
when empty.
Co-Authored-By: Claude Fable 5 <[email protected]>
* docs(architecture): add Wholphin endpoint coverage audit
Cross-references every Jellyfin endpoint the Wholphin client can call
against the routes jellycompat serves, with gating evidence for each
missing-but-unreachable endpoint and prioritized recommendations.
Co-Authored-By: Claude Fable 5 <[email protected]>
---------
Co-authored-by: Quick <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
* fix(jellycompat): parse repeated Fields query params
parseItemsQuery read the Fields parameter via q.Get("Fields"), which
returns only the first value when a client sends Fields as repeated
query params (Fields=A&Fields=B&...) instead of comma-separated in a
single param (Fields=A,B,C).
The jellyfin-sdk-kotlin (used by Wholphin) sends repeated params. When
such a request listed a detail-only field like MediaSources after other
fields — e.g. the episode-playlist request
/Shows/{id}/Episodes?Fields=PrimaryImageAspectRatio&...&Fields=MediaSources&...
silo saw only the first value (PrimaryImageAspectRatio), so
needsDetailFields stayed false, the request took the list path, and the
response came back without MediaSources. Clients then could not start
playback of the returned episodes ("no media sources").
Join all repeated Fields values before splitting on commas so field
order and delimiter style no longer matter. Comma-separated single-param
clients (e.g. VidHub) are unaffected.
* fix(jellycompat): stop advertising CanDownload and stub ThemeSongs
Wholphin (jellyfin-sdk-kotlin) audit surfaced two reachable gaps:
- mapping.go set CanDownload=true on every playable item while no
/Items/{id}/Download route exists, sending clients that honor the flag
(e.g. Wholphin's screensaver/slideshow) into 404s. Advertise false until
a download route exists.
- GET /Items/{id}/ThemeSongs 404'd, so enabling theme songs in Wholphin
silently failed on every detail page. Stub it with an empty
ThemeMediaResult. This cannot reuse the generic item stub: the SDK
models OwnerId as non-nullable, so the response must include it even
when empty.
Co-Authored-By: Claude Fable 5 <[email protected]>
* docs(architecture): add Wholphin endpoint coverage audit
Cross-references every Jellyfin endpoint the Wholphin client can call
against the routes jellycompat serves, with gating evidence for each
missing-but-unreachable endpoint and prioritized recommendations.
Co-Authored-By: Claude Fable 5 <[email protected]>
---------
Co-authored-by: Quick <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
…orrections (#675) * docs: prune shipped plan/spec artifacts, distill durable design into architecture docs The docs/superpowers/{plans,specs} tree had grown to 121 files (~3.4MB), all describing work that has since shipped. Stale plans are a hazard for agentic work — agents retrieve and trust them over the code. This removes the tree and the other one-shot artifacts (retired security-report tombstones, old audit notes, PR screenshots, shipped-feature mockup HTML), and gitignores docs/superpowers/ so future plans stay out of git. Durable content from the source-referenced specs was distilled first: - docs/architecture/notifications.md (fanout eligibility, webhook trust/SSRF rules, HMAC signing, retry/auto-disable, Discord URL-leakage policy) - docs/architecture/settings-contract.md (canonical settings contract, canonicalization/versioning invariants) - docs/architecture/invitations-onboarding.md (invite token lifecycle, account/profile mapping, onboarding tour contract) - downloads design notes folded into docs/downloads-api.md - kindle/epub conversion design folded into tools/mobitool-wasm/README.md All source comments that pointed at plan/spec files now point at the surviving docs (three were already dangling). Also fixes the dead docs/architecture/plugin-development.md link in DEVELOPMENT.md and updates CLAUDE.md/CONTRIBUTING.md with the plans-are-ephemeral policy. Migration file comments referencing old specs are left as-is (historical records; content recoverable from git history). Co-Authored-By: Claude Fable 5 <[email protected]> * docs: add 'What Silo is' identity section to CLAUDE.md Captures the project's settled direction for agents and contributors: the cluster-first scale bet, open-platform stance, the core-vs-plugin rule, KISS taste, and the current QA-era posture. Deliberately names no other projects. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: add glossary, dataflow map, and done-checklist to CLAUDE.md Borrowed from T3 Code's hand-written AGENTS.md structure: a glossary pinning the ambiguous nouns (account/profile, item/file, section, node, session, jellycompat/v1), a five-line dataflow map of scanner-to-playback, an explicit completeness checklist for client-visible changes, focused-tests-while- iterating guidance, and a severity marker on the irreversible gotchas. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: relax v1 API posture to match alpha reality Pre-lock, restructuring the API is in scope and larger coordinated sweeps are preferred over incremental breaks with compat shims. The additive-only rules become binding at v1 lock (1.0); until then they are the design target for new endpoints. The identity section now defers to the v1 rules section instead of stating its own strictness level. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: fix fact-check findings in distilled architecture docs A code-verified fact-check pass caught two errors in the freshly distilled docs and dead links left by the prune: invitations-onboarding named the SQLite profile_onboarding table as the completion store when the default backend is Postgres (user_profile_onboarding) behind userstore.UserStore; notifications claimed allowed_mentions always serializes an empty parse list when the payload actually omits the field (embeds cannot ping because content is never set); v1-scope linked four times into the deleted docs/superpowers tree, now pointed at settings-contract.md / playback-protocol-v3.md. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: apply verified fact-check corrections, drop expired audit docs A 29-doc fact-check pass (each claim chased to code, each finding adversarially verified) found 8 docs with confirmed staleness. This applies the corrections that belong on main: - wiki/admin/collection-templates.md: rewritten against shipped code — the catalog has 100+ templates (doc listed ~34), five sources (doc listed three), the template-bundles feature was entirely undocumented, and the library picker is a multi-select. Now describes categories rather than enumerating templates so it cannot rot the same way again. - architecture/observability.md: canonical component list gains access and diagnostics; the settings / webhook_sync api-handler exceptions are recorded as grandfathered. - s3-storage-setup.md: 'Public Endpoint' renamed to the actual UI label 'Read Endpoint' (s3.public_read_endpoint); the Cloudflare is_timed_hmac_valid_v0 guidance was verified correct against Cloudflare's docs and stands. - design/2026-08-16-intro-skip-mode.md: status header corrected — shipped in silo-server (#660), not proposed. Removed as expired rather than fixed: - architecture/wholphin-endpoint-coverage.md: a 2026-06-09 endpoint audit whose 'missing/broken' claims were all fixed within a week (PRs #110, #164) and never updated; redoing the audit is the only honest fix. - design/2026-07-09-streaming-write-deadline.md: marked 'planned' but shipped in the same commit that added it; the implementation and its tests (internal/httpstream/rolling_deadline.go) are the durable record. Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]>
Problem
parseItemsQueryreads theFieldsparameter viaq.Get("Fields"), which returns only the first value when a client sendsFieldsas repeated query params (Fields=A&Fields=B&...) rather than comma-separated in a single param (Fields=A,B,C).The
jellyfin-sdk-kotlin(used by Wholphin) sends repeated params. When such a request lists a detail-only field likeMediaSourcesafter other fields, silo only sees the first value and never switches to the detail path — so the response comes back withoutMediaSources.Concretely, Wholphin's episode-playlist request is:
q.Get("Fields")returnsPrimaryImageAspectRatio, soneedsDetailFieldsstaysfalse, the request takes the list path, and the returned episodes have noMediaSources. Wholphin then can't start playback of those episodes — it shows "Item has no media sources, skipping…" when auto-advancing to the next episode (and after skip-outro).This looked data-dependent because the season-display request happened to list
MediaSourcesfirst (worked), while the playlist request listed it later (broke). Comma-separated single-param clients (VidHub, Infuse) were never affected.Fix
Join all repeated
Fieldsvalues before splitting on commas, so field order and delimiter style no longer matter:Testing
TestRepeatedFieldsParamTriggersDetailreproduces the exact Wholphin request shape and assertsneedsDetailFields+ the parsed field set.TestCommaSeparatedFieldsStillParsedguards the existing single-param comma-separated form.internal/jellycompatsuite passes;go vetclean.Summary by CodeRabbit
New Features
Bug Fixes
CanDownloadflag incorrectly indicating download support availability.Fieldsquery parameter parsing to capture all submitted values instead of only the first.Documentation