Repository navigation
fix(jellycompat): serve real MediaSources on Resume/NextUp pages - #69
Conversation
Infuse and SenPlayer build Continue Watching rows from the listing's MediaSources and discard responses that carry only the detail-field stub, leaving the row empty. Keep the progress scan list-level (the per-entry GetItemDetail fanout removed in the error-report-2026-05-08 §6 fix stays removed), but re-map the returned page — bounded by the request limit, capped at 100 — through the detail path when the client requests detail-level Fields, matching HandleLatest's existing pattern. The stub remains as the fallback past the cap and is made honest: playability flags set, collections serialized empty instead of null.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR implements page-bounded detail upgrading for resume/next-up progress lists while fixing the MediaSources stub to remain playable. Progress hydration now carries detail-upgrade inputs, pagination logic refactors to extract finishProgressPage/upgradeProgressPageToDetail for conditional per-item remapping, NextUp applies the pattern to its returned page with proper ID tracking, and the stub is enhanced with playable flags and non-null collections. ChangesResume/NextUp detail upgrade and playable MediaSources stub
🎯 4 (Complex) | ⏱️ ~45 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 |
Infuse and SenPlayer build Continue Watching rows from the listing's MediaSources and discard responses that carry only the detail-field stub, leaving the row empty. Keep the progress scan list-level (the per-entry GetItemDetail fanout removed in the error-report-2026-05-08 §6 fix stays removed), but re-map the returned page — bounded by the request limit, capped at 100 — through the detail path when the client requests detail-level Fields, matching HandleLatest's existing pattern. The stub remains as the fallback past the cap and is made honest: playability flags set, collections serialized empty instead of null.
Infuse and SenPlayer build Continue Watching rows from the listing's MediaSources and discard responses that carry only the detail-field stub, leaving the row empty. Keep the progress scan list-level (the per-entry GetItemDetail fanout removed in the error-report-2026-05-08 §6 fix stays removed), but re-map the returned page — bounded by the request limit, capped at 100 — through the detail path when the client requests detail-level Fields, matching HandleLatest's existing pattern. The stub remains as the fallback past the cap and is made honest: playability flags set, collections serialized empty instead of null.
Fixes #67
What problem does this solve
Continue Watching renders empty in Infuse and SenPlayer (details + evidence in the issue). Both clients build their rows from the listing's MediaSources;
/UserItems/Resumeand/Shows/NextUpserve a stub (Id:"0", all playability flags false,nullcollections) whenever the client requestsFields=MediaSources, so they discard the entire response. Verified by request logs: Infuse received 15 valid resume items and fetched images for 0 of them, while rendering/Items/Latest(real detail path, samefields=) normally.Why this approach
The stub exists for a good reason — the old per-entry
GetItemDetailfanout over the full in-progress list caused the 38s timeout (error-report-2026-05-08 §6). That fix is preserved: the scan loop (hydrateProgressItems, up to 200 entries per iteration for type filtering) stays strictly list-level, and the existing no-detail regression test still pins that.What changes: the returned page (bounded by the request limit, hard cap 100) is re-mapped through the per-item detail path when the client asked for detail-level Fields — the exact pattern
HandleLatestalready uses for the same Fields. Clients that don't request detail fields (jellyfin-web, Streamyfin) take the unchanged zero-cost path.The stub remains as fallback for entries past the cap or whose detail fetch fails, and is made honest: playable flags,
Name/RunTimeTicks, nested stream, andFormats/RequiredHttpHeaders/MediaAttachmentsas empty collections instead of JSONnull(real Jellyfin/Emby never serialize null arrays; strict client decoders fail the whole body on them).How it was tested
go test ./internal/jellycompat/...green; new tests:TestSlicePageIDs(pins items/pageIDs slice alignment againstsliceBaseItems), stub playability + non-null-collections + mutation-leak guards; the no-detail scan test's doc updated to describe the two-phase design.Anything to watch out for
maxDetailUpgrades=100means a client requestinglimit>100with detail fields gets stubs past 100 — documented in code, intentional.items/pageIDsslices; alignment is guaranteed by building both in the same loop with the same skip condition and is test-pinned.Implementation was AI-assisted (Claude); I've read the full diff, and the change was verified live against real Infuse/SenPlayer clients before submitting.
Summary by CodeRabbit
Release Notes
Performance
Bug Fixes