test(player): hold the session stop and the kept-point rule to the server

- The client's resume thresholds equal the server's (read from both sources).
- The session stop's URL matches the route the server serves it on.
- The player stops its server session by its item and its own id on an unload and on close,
  and keeps it when the page only goes into the back/forward cache.
This commit is contained in:
2026-10-07 23:16:38 +02:00
parent 392099770a
commit dd6a666ad1
5 changed files with 108 additions and 5 deletions
+4 -3
View File
@@ -23,9 +23,10 @@ M = TypeVar("M", bound=Base)
# Resume-position thresholds of a player that only keeps a resume point (the YouTube player, the
# library's): positions below this are "didn't really start" and within this of the end are
# "basically finished" — neither is worth storing, so the position is cleared instead (no progress
# bar). The client's local resume (`lib/resume.ts`) keeps the same two numbers. NB: the Plex player
# intentionally uses a LARGER finish margin (30s) because it marks long-form items watched, not just
# clears a resume bar — see routes/plex/playback.py.
# bar). The client's local resume (`lib/resume.ts`) keeps the same two numbers, held equal by
# `resume.contract.test.ts` beside it. NB: the Plex player intentionally uses a LARGER finish margin
# (30s) because it marks long-form items watched, not just clears a resume bar — see
# routes/plex/playback.py.
PROGRESS_MIN_SECONDS = 5
FINISH_MARGIN_SECONDS = 10