The Plex player names the playlist it plays through (v=player:<id>:playlist:<pid>), so a bookmark rebuilds the queue from the playlist's own order while the item is still in it. Found in the browser and fixed: - after a reload the shell's player opened a second one over Home and the feed: it read the catalog row the page had fetched (a disabled query still reads the shared cache); it now waits for ready. - every reload under an open overlay left a dead history step: the first overlay to open takes over the entry the document was loaded on. - the feed's address was implicit, the same as the start-page landing, so a reloaded or bookmarked feed opened as Home: the feed now names itself (page=feed) like every page. - a linked file or video that is gone was said, but stayed in the address and was said again on every reload: its keys are taken off. The overlay address is written in one place (the entry is named once it is current), and the player keys only the codec reads are no longer exported.
21 lines
915 B
TypeScript
21 lines
915 B
TypeScript
// The file an address names open on the Files page: the player's key wins over the viewer's, and only a
|
|
// real row id opens anything — a fractional, zero, negative or garbled one would look up a row that
|
|
// cannot exist and say the file is gone.
|
|
import { describe, expect, it } from "vitest";
|
|
import { openFileFrom } from "./filesUrlState";
|
|
|
|
const from = (q: string) => openFileFrom(new URLSearchParams(q));
|
|
|
|
describe("openFileFrom", () => {
|
|
it("reads the viewer's and the player's file", () => {
|
|
expect(from("fview=3")).toEqual({ open: "view", id: 3 });
|
|
expect(from("fplay=4")).toEqual({ open: "play", id: 4 });
|
|
expect(from("fview=3&fplay=4")).toEqual({ open: "play", id: 4 });
|
|
});
|
|
|
|
it("opens nothing for an id that is not a positive integer", () => {
|
|
for (const raw of ["1.5", "0", "-2", "abc", ""]) expect(from(`fview=${raw}`)).toBeNull();
|
|
expect(from("q=x")).toBeNull();
|
|
});
|
|
});
|