Repository navigation
Play torrent sources through the existing player - #3
Merged
Merged
Conversation
A title that is not in the library can now be streamed from a torrent source and played immediately. The player does not know where the bytes came from. The whole design turns on one seam: PlaybackViewModel already had a branch for a remote MediaSourceInfo carrying a raw URL, which is how Jellyfin represents a source it does not manage. Synthesising one of those for a torrent stream means the existing Media3 pipeline, track selection, seek bar, controls and overlay all work untouched. No second player, and no custom DataSource — that would have been ExoPlayer-only and silently broken the MPV backend. TorrentMediaSource is the single place that synthesis happens, so if a neutral PlaybackSource abstraction is ever warranted there is one seam to change. Deliberately not built yet: two implementations where one is a thin adapter does not justify refactoring StreamChoiceService and QualityManager. The picker offers at most five labelled choices, deduplicated by source id because the same release is often best on several axes. The full ranked list is behind "Show all sources", and release names, share counts and indexer names only appear behind "Show details" — no viewer needs to read the word "seeder". Request stays the first-focused action; finding sources is a later item in the row and disappears entirely once a title is available, so the library route is always the encouraged one. Nothing searches implicitly: the only automatic call asks the server which features it offers, and browsing has no path to an indexer. Failure states are all recoverable. A dead source reopens the ranked list rather than dropping the viewer back on the details page, and retry is only offered where retrying can help. Torrent playback deliberately skips watch-activity reporting, resume persistence and next-up, since those are keyed on a real Jellyfin item id that a one-off stream does not have. Source search and session-open each get their own long-timeout HTTP client. The shared 30s read bound cut both off mid-flight: a cold indexer sweep takes tens of seconds, and opening a session has to fetch torrent metadata from peers and prebuffer before it can answer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jkrishna289
added a commit
that referenced
this pull request
Sep 11, 2026
Play torrent sources through the existing player
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a title that is not in the library be streamed from a torrent source and played immediately. Requires Orca Engine 1.0.14.1 with
FeatureSourceStreamingenabled.The seam
PlaybackViewModelalready had a branch for a remoteMediaSourceInfocarrying a raw URL — Jellyfin's own representation of a source it does not manage. Synthesising one of those for a torrent stream means the existing Media3 pipeline, track selection, seek bar, controls and overlay all work untouched.No second player, and no custom
DataSource: that would have been ExoPlayer-only and silently broken the MPV backend.Design rules made structural
Verified on device
Streamed a torrent end to end on a TV emulator against a live server: first frame rendered via DirectPlay, position advanced, seeks to 181s and 212s landed and resumed, and the seek bar showed the true 14:48 runtime from server-side ffprobe.
Not included
DiscoverSeriesDetailsis unchanged🤖 Generated with Claude Code