fix(plex): a Restart does not replay on a reload or a Forward onto the player

fromStart rode in history.state._sub, so reloading the player entry restarted
the item from 0 again and the progress checkpoint overwrote its resume point.
A sub-view config can now say what the history entry keeps of a view.
This commit is contained in:
2026-09-27 14:03:48 +02:00
parent de62035889
commit 383c85231a
4 changed files with 57 additions and 2 deletions
@@ -76,3 +76,18 @@ describe("PLEX_SUB_URL decode guards", () => {
expect(U.decode("")).toBeNull();
});
});
describe("PLEX_SUB_URL entry", () => {
// E28 review E1: the Restart click must not replay on a reload / Forward onto the player entry.
it("keeps the player without its one-shot fromStart, and every other view whole", () => {
const entry = U.entry!;
expect(entry({ kind: "player", id: "7", queue: ["7", "8"], fromStart: true })).toEqual({
kind: "player",
id: "7",
queue: ["7", "8"],
fromStart: undefined,
});
const info = { kind: "info", id: "7" } as const;
expect(entry(info)).toBe(info);
});
});