A session's NowPlayingItem carries none of the selected source's media streams #211
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A session's
NowPlayingItemcarries noMediaStreams, where upstream fills them from the selected source. Found by replaying the scenario #204 added, against a live pair — the first time anything has diffed a session while it is playing.Both sides
Upstream removes the field from the DTO options and then puts it back by hand,
upstream/Emby.Server.Implementations/Session/SessionManager.cs:1906-1958:So the removal is real and so is the refill: what a session carries is not the item's streams but the selected source's.
Ours does the first half only.
crates/ephyra-http/src/map/fields.rs:71-84stripsMediaStreamsalongsideMediaSources, citingGetItemInfo— accurate as far as the field list goes, and the reason that follows it ("weight a client polling/Sessionspays for repeatedly") reads as though the removal were the whole of upstream's answer. Nothing refills it.What a client sees
Replaying
crates/ephyra-harness/scenarios/sessions.jsonagainst the pair, every read of a playing session differs the same way — 5 of 13 responses:This is a shape difference, not a value one: the key is absent rather than different, so no value-scoped ignore entry hides it.
The dashboard's now-playing card is what reads them — a stats panel names the video and audio stream it is playing from, and
DisplayTitleis the string it shows.The shape of the fix
The streams wanted are the selected source's, which is the same seam #203 just built: a progress report names
MediaSourceId, andcrates/ephyra-http/src/routes/session/playstate.rsalready resolves it to get that source's runtime. Whatever resolves the runtime can resolve the streams.Where they are kept is the open question, and it is not free either way:
info.Itemholds the resolved DTO until the next report).Liveisephyra-appand the stream DTOs areephyra-dto;ARCHITECTURE.mdis what says whether that edge is legal, and it likely is not.now_playing_items(crates/ephyra-http/src/routes/session/sessions.rs:239-272), which keeps the DTOs inephyra-httpwhere they belong but re-resolves per read, and/Sessionsis polled.The second looks right for this port even though it is not upstream's mechanism; that makes it a divergence in mechanism with identical effect, which
DECISIONS.md:1150-1155wants written down either way.Verifying
crates/ephyra-harness/scenarios/sessions.jsonalready covers it — the difference above is the current output, so the fix is done when those 5 differences are 0.cargo xtask reference up, then replay against ours on 8097.Found replaying #204 (
issues/sessions).Fixed in
94a5472dand1ef63ccf, landed onmainatf0ffda81.When the playstate route resolves the selected source for a report, it keeps that source's stream rows on the registry next to its runtime.
map::session::infoturns them intoMediaStreams, so a/Sessionspoll costs no query. When the source cannot be resolved, the key is left out, as upstream serves it. Language normalisation is shared withmap::mediathroughfiled_streams.Replaying
sessions.jsonagainst a pair now gives 0 differences, down from 5. Both servers carryMediaStreamsin the same 5 responses. Route tests cover the selected version's streams, the item's own streams, and no key for a source that is not one of the item's versions. Each test was checked by mutating the code under it.Not done: a report that posts a full
Itemis still described from the library row, where upstream uses the postedItemas is. No mainstream client posts one.