Repository navigation
fix(jellycompat): match the Static stream query parameter case-insensitively - #157
Conversation
|
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 (2)
📝 WalkthroughWalkthrough
ChangesCase-insensitive Static direct-play fix and tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Problem
GET /Videos/{id}/stream?static=true(lowercase key) returns404 "Playback session not found"for clients that direct-play without first callingPlaybackInfo.HandleVideoStreamreads the static-play guard case-sensitively (r.URL.Query().Get("Static")), so a lowercasestatickey never triggers the on-the-flycreateStaticPlaySessionfallback, and the earlierresolvePlaybackRouteerror surfaces as a 404.Observed against a live deployment: SenPlayer sends
static=true(lowercase) and 404s ~83% of its direct-play attempts (≈246 fail / 50 ok in a ~20-minute capture). A validapi_key/X-Emby-Token/PlaySessionIdis present, so this is not an auth failure. Any client that lowercasesstaticis affected.Approach
Read the guard through the package's existing
newCaseInsensitiveQueryhelper (already used forPlaySessionIdinauth.goandHandleMasterManifest) sostatic/Static/ any casing matches. One line; the value comparison was already case-insensitive viastrings.EqualFold. This is the same case-insensitive-query class as the prior Wholphin lowercaseplaySessionIdfix.Testing
New
playback_static_directplay_test.go:static=truenow serves the file (was 404)Static=truestill serves (regression guard for the original Infuse path)static+ no prior session still 404s (the fallback must not fire unconditionally)static+mediaSourceId(the exact SenPlayer call shape)go test ./internal/jellycompat/...passes in a libvips-capable container. The test was mutation-verified (fails when the fix is reverted).Notes
Additive and behavior-preserving — it only broadens which query-key casings trigger the existing static-play path.
AI-use disclosure: implemented and tested with AI assistance (Claude Code). The diff and tests were human-reviewed and run in a libvips Docker container.
Summary by CodeRabbit