A playing position is bounded by the item's runtime, not the media source's #203
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?
The advancing position added in
78be052eis bounded by the item row's runtime. Upstream bounds it by the selected media source's, which is a different number whenever a client is playing something other than the primary version.Upstream
upstream/Emby.Server.Implementations/Session/SessionManager.cs:406-422:and
SessionInfo.csclamps onprogressInfo.Item?.RunTimeTicks— that overwritten value.Ours
crates/ephyra-http/src/map/session.rs:34-39passesnow_playing_item.run_time_ticks, andcrates/ephyra-http/src/routes/session/sync_play.rs:583-589passes the item row's runtime. Both arerow.run_time_ticks(crates/ephyra-http/src/map/item/mod.rs:190), andFields::now_playing()stripsMediaSources(crates/ephyra-http/src/map/fields.rs:73) — so the selected source's runtime is not in reach of either read site.What it costs
Reachable: alternate versions are supported (
crates/ephyra-http/tests/versions.rs) and each source carries its own runtime (crates/ephyra-http/src/map/media.rs:51,160).ItemId= the primary,MediaSourceId= the cut. At a reported 99:59 upstream goes on advancing to 119:59; we freeze at 99:59.MediaSourceInfo.RunTimeTicksis null: upstream then clamps nothing at all, and we clamp at the program row's runtime.The shape of the fix
The read sites need the selected source's runtime, which the session already names (
MediaSourceIdarrives on every progress report). Either the registry keeps the runtime it was told about atplaying()time, or the read resolves the source. The first is smaller and matches upstream, which stores the resolved number oninfo.Item.RunTimeTicksrather than re-resolving on each tick.Live::position_ticks_attakes the runtime from its caller, so any future reader that forgets it silently gets an unbounded advance — worth closing at the same time.Found reviewing #201 (
1fe062f5).Fixed in
e78c7aadand1ef63ccf, landed onmainatf0ffda81.The advance is bounded by the runtime of the source the report selected. It is resolved when the report arrives and kept on the registry.
Live::position_ticks_atno longer takes a runtime from its caller.A
MediaSourceIdis matched only among the item's own versions, as in upstream'sGetPlaybackMediaSources. An id that is not one of them falls back to the item's runtime. The route tests file the cut as a real version of the film.is_advancingcovers1..=room, so the last second advances too.Left as is:
LiveStreamIdis not consulted, so live TV sources are not resolved.