Repository navigation
Conversation
A zero-byte or corrupt file that ffprobe rejected came back from PlaybackInfo as one direct-playable source with no container, size or streams. Jellyfin clients tried to play it and failed in the player, while the native API refuses the same file as unreadable (Silo-Server#1810). catalog.FileVersion now carries models.MediaFile.ProbeRejected as an unserialized Unreadable flag, and PlaybackInfo leaves those versions out. When nothing the request can use is left, including a MediaSourceId that names an unreadable version, it answers as Jellyfin does: 200 with no media sources and ErrorCode NoCompatibleStream, which clients show to the viewer. Files that were never probed are offered as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:
|
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughPlayback negotiation now excludes versions marked unreadable by ffprobe. When no selected readable version remains, the endpoint returns HTTP 200 with an empty ChangesPlaybackInfo unreadable-version handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant Catalog as catalog.FileVersion
participant Handler as HandlePlaybackInfo
participant DTO as playbackInfoResponseDTO
participant Client as Jellyfin client
Catalog->>Handler: FileVersions with Unreadable flags
Handler->>DTO: Empty MediaSources and NoCompatibleStream
DTO->>Client: HTTP 200 response
Suggested reviewers: Merge Risk: ⚪ Minimal · up to PlaybackInfo excludes known unreadable versions while retaining unprobed files. No merge-blocking issue is established; proceed with normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
Evidence: FAIL This PR has no Evidence section, and the template's Evidence checklist item was removed too. The change is user-visible under CONTRIBUTING's "Show visible changes": it changes a jellycompat response that clients render (empty The Validation section already describes the before and after runs in prose. To pass, please add an Evidence section with:
Grok commenting on Quick's behalf. |
Review summaryReviewed head: Findings: none. I fixed nothing and pushed nothing to this branch. What I checked:
One observation, not a defect: the Jellyfin Kodi add-on reads The docs already name the remaining gaps: Evidence: the Evidence section now has before-and-after Validated features: #1246 C1 (Jellyfin compatibility smoke matrix) is listed as changed and hasn't been run yet, so no passed case regresses. The validator should cover the zero-byte case when they run C1. User manual: unaffected. No siloserver.org page describes how Jellyfin clients handle damaged files. Apple/Android parity: not needed. The first-party apps use the native API, which already refuses these files (#1810). Fit: 9/10 · Readiness: 9/10 — ready
Claude ( |
Requested by Tobechukwu Njoku
Problem
Closes #1812
Related issue: N/A
Validation tasks: changes #1246 C1
Jellyfin clients were offered files Silo knows it cannot play. For a zero-byte or corrupt file that ffprobe rejected,
PlaybackInforeturned one direct-playable source with no container, size or streams. The client tried to play it and failed in its player with no explanation, while the native API refuses the same file as damaged (#1810).Approach
catalog.FileVersioncarriesmodels.MediaFile.ProbeRejected, the rule #1810 added (ffprobe rejected the file and nothing usable is recorded), asUnreadable. The field is not serialized, so neither the v1 nor the v2 view changes.PlaybackInfoleaves unreadable versions out. When nothing the request can use is left, including aMediaSourceIdthat names an unreadable version, it answers the way Jellyfin does when nothing can play:200with an emptyMediaSourceslist,ErrorCode: "NoCompatibleStream"and no play session. Jellyfin Web shows that as a playback error instead of trying to play. Files that have not been probed yet are offered as before.A request that names the unreadable version gets the error, not a different version, in the same way a route naming a version the item no longer has answers
404rather than substituting. The existing400 PlaybackUnavailableanswer for sources that do not fit the client's constraints is unchanged.Validation
gofmt,go vetandmake lint-changedare clean.ProbeRejected. With the new behaviour removed and the fields kept, the six that expect it fail; all pass here.make test-goon this machine fails ininternal/jellycompat(TestPlaybackInfoWithoutStripOrToneMapStillHasNoRoute,TestPlaybackInfoSkipsStripWhenRPUCannotBeStripped),internal/apiv2(TestAdminResourceCapabilitiesAndScope) andinternal/playback(hardware transcoding probes). Each of those fails the same way on unchangedmainon this machine. A few hardware-probe andinternal/transcodenodetests failed in a full run on one tree but not the other; run on their own, they pass or fail identically on both. CI is the reference.mainand of this branch against the same database: an offline movie library with a zero-byte file, and a movie with a readable 1080p file and a zero-byte 720p file. Onmain, the zero-byte movie gets one direct-playable source with no size, container or streams, the two-version movie gets both sources, and asking for the 720p file byMediaSourceIdreturns it. On this branch, the zero-byte movie gets200,ErrorCode: "NoCompatibleStream", no sources and noPlaySessionId; the two-version movie gets only the 1080p source; and asking for the 720p file getsNoCompatibleStream.Evidence
Same requests against
mainand this branch, trimmed to the fields that changed. Every answer is HTTP 200. Paths are cut to the file name and the play session id is replaced.POST /Items/{Empty One}/PlaybackInfowith{}. The item's only file is zero bytes.Before (
main):{ "PlaySessionId": "<id>", "MediaSources": [ { "Path": ".../Empty One (2020).mkv", "Container": null, "Size": null, "SupportsDirectPlay": true, "SupportsDirectStream": true, "MediaStreams": "[0 streams]" } ] }After (this branch):
{ "ErrorCode": "NoCompatibleStream", "MediaSources": [] }POST /Items/{Two Versions}/PlaybackInfowith{}. The item has a readable 1080p file and a zero-byte 720p file.Before (
main):{ "PlaySessionId": "<id>", "MediaSources": [ { "Path": ".../Two Versions (2022) - 1080p.mkv", "Container": "mkv", "Size": 77500, "SupportsDirectPlay": true, "SupportsDirectStream": true, "MediaStreams": "[2 streams]" }, { "Path": ".../Two Versions (2022) - 720p.mkv", "Container": null, "Size": null, "SupportsDirectPlay": true, "SupportsDirectStream": true, "MediaStreams": "[0 streams]" } ] }After (this branch):
{ "PlaySessionId": "<id>", "MediaSources": [ { "Path": ".../Two Versions (2022) - 1080p.mkv", "Container": "mkv", "Size": 77500, "SupportsDirectPlay": true, "SupportsDirectStream": true, "MediaStreams": "[2 streams]" } ] }The same request with
{"MediaSourceId": "<the 720p source>"}.Before (
main):{ "PlaySessionId": "<id>", "MediaSources": [ { "Path": ".../Two Versions (2022) - 720p.mkv", "Container": null, "Size": null, "SupportsDirectPlay": true, "SupportsDirectStream": true, "MediaStreams": "[0 streams]" } ] }After (this branch):
{ "ErrorCode": "NoCompatibleStream", "MediaSources": [] }Surface and build: Jellyfin-compatible API,
POST /Items/{id}/PlaybackInfo. Before:mainat c762177; after: this branch at a7159a2. Local builds against the same offline test library, with test media only.Jellyfin Web 12.1, built from the
v12.1tag withsilo compat-web installand served by each build, signed in with a test account. "Two Versions" with its zero-byte 720p version selected, then Play:main)On
main, PlaybackInfo offers the zero-byte file, no stream request follows, and Jellyfin Web shows only its generic error. On this branch, Jellyfin Web 12.1 also opens that generic dialog on top of the NoCompatibleStream one: aftervalidatePlaybackInfoResultshows theErrorCodemessage it rejects, andonPlaybackRejectionaddsErrorDefault. It does this for anyErrorCodeanswer, Jellyfin's own included. So the viewer sees the generic dialog first and the NoCompatibleStream message after closing it:Risks
ErrorCodeand readsMediaSources[0]gets an empty list where it used to get a source that could not play. Jellyfin itself answers this way, so clients written against Jellyfin already meet this answer.PlaySessionIdis now left out when empty. Every answer with sources still sets it.Static=truedirect play, which Infuse and SenPlayer use, andGET /Items/{id}, which lists it as direct-playable. Covering those is a follow-up.Checklist
AI Disclosure
Static=truedirect play andGET /Items/{id}still offer the file. Two tests were added, the doc and the code comment were corrected, and the remaining gap is listed under Risks.Note
Omit ffprobe-rejected files from jellycompat PlaybackInfo responses
FileVersionvalues as unreadable when ffprobe rejected the underlying file with no usable stream data, via a new internalUnreadablefield in detail.go excluded from JSON outputHandlePlaybackInfoin handlers_playback.go skips unreadable versions; if all matching versions are unreadable it returns HTTP 200 with an emptyMediaSourceslist andNoCompatibleStream, without creating a play sessionStatic=truedirect play are unchangedplaybackInfoResponseDTOin dto.go omitsPlaySessionIdwhen absent and adds anErrorCodefield; requests naming an unreadableMediaSourceIdnow getNoCompatibleStreaminstead of a playable sibling versionMacroscope summarized a7159a2.