Bound native media preview capabilities and source range reads

This commit is contained in:
karl committed 2026-10-13 14:22:19 +02:00
1 parent 4b0b5ebfd9
commit 370db7e791
13 files changed
+834 -46

No files matched your search

+13
View File
@@ -6,10 +6,23 @@ import {
sourceLabel,
matchLabel,
PreviewRevision,
previewSelectionKey,
} from "../src/media-display.ts";
import { LatestLane } from "../src/search-state.ts";
const settle = () => new Promise((resolve) => setImmediate(resolve));
test("indexed content refresh invalidates a decoded preview at the same path", () => {
const revision = new PreviewRevision();
const source = { kind: "timestamp_ms", number: 1200 };
const first = revision.select(previewSelectionKey("recording.mp4", source, 1));
const repeated = revision.select(previewSelectionKey("recording.mp4", source, 1));
assert.equal(repeated.changed, false);
const refreshed = revision.select(previewSelectionKey("recording.mp4", source, 2));
assert.equal(refreshed.changed, true);
assert.equal(revision.accepts(first.revision), false);
assert.equal(revision.accepts(refreshed.revision), true);
});
test("millisecond seeks preserve fractions and readable minute labels", () => {
assert.equal(timestampLabel(125450), "2:05");
assert.equal(timestampLabel(3600000), "60:00");