Repository navigation
fix(jellycompat): report hls sub-protocol only for sources played via TranscodingUrl - #2934
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:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
The item-detail media source in Suggested fix: No diff — include the item-detail response excerpt before and after, trimmed to the changed field. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
#1246 C1 is Not run, so this PR does not unblock a failed or blocked result. The changed
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
Updated the line to Macroscope's suggestion: |
|
Checked against a running server while validating #1246 C1: Jellyfin Web 12.1 in Google Chrome, synthetic h264/AAC and HEVC/AC-3 MKV files, a child profile and a separate restricted account.
|
Quick104
left a comment
There was a problem hiding this comment.
One low-severity finding, below. The change itself checks out against Jellyfin Web 10.10.7, 10.11.0 and current master, which all play stream.{container} when either direct flag is set, and against jellyfin-android, whose only HLS requirement is in its transcode branch, chosen under the same predicate this PR uses.
… TranscodingUrl PlaybackInfo set TranscodingSubProtocol to hls on every media source, including direct-play and direct-stream ones. Jellyfin Web plays those through the static stream URL but chooses hls.js from this field alone, so Chrome handed a raw MKV to hls.js and playback never started. Report hls only when the source can only be played through its TranscodingUrl, and http (Jellyfin's default) otherwise, including on item-detail media sources. Closes Silo-Server#2879
Swiftfin plays any TranscodingUrl it receives, so the comment's claim that Jellyfin clients play the direct URL whenever a direct flag is set did not hold for every client. Co-Authored-By: Claude Opus 5.5 <[email protected]>
e122e78 to
22ef246
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:
|
Review summaryReviewed head: 22ef246 (the original commit rebased onto current Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
Addressed
Checked and not a problem
Left for maintainers
Validated featuresNo passed case on the v1.0 board is reached by this change. #1246 C1 is Not run and fails on the base for Jellyfin Web, so I changed the body's line to Other checks
|
|
The item-detail evidence states the old and new Suggested fix: No diff — add the main and PR build/commit identifiers for the item-detail response excerpt. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
This PR unblocks the #2879 direct-play finding under #1246 C1. The 23 Oct task update records it on the base build; this change alters the protocol field behind Jellyfin Web’s HLS selection. That update’s fix-stack run is unpublished and awaits human acceptance, and C1 still needs a published-build re-test after the separate #2970 series-page fix ships. The Please update the PR line to:
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
Problem
Closes #2879
Related issue: N/A
Validation tasks: unblocks #1246 C1
Jellyfin Web in Chrome, Firefox and Android browsers cannot direct play a file that Silo can also transcode. The video stays on the loading spinner. This change makes PlaybackInfo report
TranscodingSubProtocol: "hls"only on sources the client will play through the HLSTranscodingUrl, as Jellyfin does.Silo set
TranscodingSubProtocoltohlson every media source. Jellyfin Web plays the static/Videos/{id}/stream.{container}URL wheneverSupportsDirectPlayorSupportsDirectStreamis true, but it picks hls.js fromTranscodingSubProtocolalone. hls.js then gets a raw MKV and fails withmanifestParsingError.Approach
mediaSourceDTOnow reportshlsonly when the source supports transcoding and neither direct flag is set. Every other source reportshttp, which is Jellyfin's default. Item-detail media sources always claim direct play and carry noTranscodingUrl, so they reporthttptoo. The field is always present because Kotlin SDK clients fail to deserialize a response without it.Other Jellyfin clients, checked against their source:
hlsthere.The Jellyfin Web retry after a failed direct play (direct play and direct stream disabled) is a transcode-only source, so it still gets
hls.Jellyfin leaves out
TranscodingUrlon direct-play sources, while Silo keeps it, so Swiftfin plays the HLS URL even when it could direct play. That is older behavior, out of scope here.Validation
go test ./internal/jellycompat/...: the new table test fails before the fix and passes after it. Two DV-strip tests (TestPlaybackInfoWithoutStripOrToneMapStillHasNoRoute,TestPlaybackInfoSkipsStripWhenRPUCannotBeStripped) also fail locally on unchangedmain, because the local FFmpeg build differs from CI's. CI onmainpasses them.go vet ./internal/jellycompat/,gofmt,goimportsandmake lint-changed: clean.make verify-local-paths: clean.Evidence
PlaybackInfo response for an h264/AAC MKV, using a Chrome-like device profile (direct play mkv/mp4 h264+aac, HLS ts transcoding), trimmed to the fields involved. Captured by calling the PlaybackInfo handler in-process (not a committed test) on
mainand on this branch.SupportsDirectPlay: true,SupportsDirectStream: true,TranscodingSubProtocol: "hls"SupportsDirectPlay: true,SupportsDirectStream: true,TranscodingSubProtocol: "http"SupportsDirectPlay: false,SupportsDirectStream: false,TranscodingSubProtocol: "hls"TranscodingSubProtocol: "hls"Item detail (
GET /Users/{userId}/Items/{id}),MediaSources[]for the same file:TranscodingSubProtocolwas"hls"and is now"http". These sources setSupportsDirectPlay: trueand carry noTranscodingUrl; the value is a constant indetailMediaSourceDTO.Full excerpts
Before:
After:
Surface and build: jellycompat
POST /Items/{id}/PlaybackInfo,mainat 3bc9e58 compared with this branch.Risks
A Jellyfin client that played the
TranscodingUrlon a direct-play or direct-stream source and readTranscodingSubProtocolto pick an HLS player would now seehttp. None of the clients checked above do this.Checklist
AI Disclosure
Note
Report HLS sub-protocol only for transcode-only sources in jellycompat
Fixes
TranscodingSubProtocolin Jellyfin media-source DTOs. It now defaults to HTTP and reports HLS only when a source can be played via aTranscodingUrl(transcoding supported without direct play or direct stream).MediaStreamProtocolvalues in dto.go and uses them instead of string literalsPlaybackHandler.mediaSourceDTOanddetailMediaSourceDTOMacroscope summarized 22ef246.