fix(items): return MediaSources when an item is fetched by MediaSourc… - #416
fix(items): return MediaSources when an item is fetched by MediaSourc…#416A-wes wants to merge 2 commits into
Conversation
…e id
Android TV refetches an item by MediaSource id when the user picks a
different version, and `item_for_user` already answers that: it resolves the
Stream row and sets `sources` to the row itself.
`db_media_to_item` then discarded that work. Its `MediaSources` block is
gated on `Movie | Episode | Track`, so for a `Stream` row the field was never
populated and `skip_serializing_none` omitted it from the response entirely.
`GET /Items/{mediaSourceId}` returned 200 with `Type: "Video"` and no
`MediaSources` at all.
A client that reads `MediaSources` off that response with no `PlaybackInfo`
round-trip therefore gets null. Jellyfin for Android TV dereferences it
unguarded in `PlaybackController.buildExoPlayerOptions` and crashes:
java.lang.NullPointerException: Attempt to invoke virtual method
'java.util.List org.jellyfin.sdk.model.api.MediaSourceInfo.getMediaStreams()'
on a null object reference
The app relaunches, retries the same item and crashes again, so playback
never recovers.
Add `Stream` to the gate so the sources `item_for_user` resolved are actually
serialised.
|
i cannot replicate this. bug reports are appreciated but please just open an issue instead of posting AI slop prs what jellyfin app version are you on? and what remux version |
|
Hi, sorry, I will open issues in the future, feel free to close the PRs (I was creating them as a reference to what seems to be fixing the issue, not expecting them to merged. I understand that it is annoying). |
|
ar you playing from the details |
|
I do not have groups set up in remux. Also it looks like this is happening when I select the full season packs (big files 10+GBs) They are often the only available source AIOStreams returns. Can groups solve this? |
|
season packs? are you using p2p or debrid? and are you using aiostreams |
|
k ill have to test that. didn't know aiostreams supported packs |

Hi, while testing HEVC playback fix on my shield ran into an issue when picking alternative media source results in client crash. Below is claude's explanation of what's happening after reading server logs and org.jellyfin.androidtv client logs uploaded after crash. I verified crash does not happen after adding this
Android TV refetches an item by MediaSource id when the user picks a different version, and
item_for_useralready answers that: it resolves the Stream row and setssourcesto the row itself.db_media_to_itemthen discarded that work. ItsMediaSourcesblock is gated onMovie | Episode | Track, so for aStreamrow the field was never populated andskip_serializing_noneomitted it from the response entirely.GET /Items/{mediaSourceId}returned 200 withType: "Video"and noMediaSourcesat all.A client that reads
MediaSourcesoff that response with noPlaybackInforound-trip therefore gets null. Jellyfin for Android TV dereferences it unguarded inPlaybackController.buildExoPlayerOptionsand crashes:The app relaunches, retries the same item and crashes again, so playback never recovers.
Add
Streamto the gate so the sourcesitem_for_userresolved are actually serialised.Fuller log just in case: