MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / fetchCastDuration

Function fetchCastDuration

e2e/viewer/src/SessionPlayer.tsx:54–59  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

52/** The cast's own duration: timestamp of its last event (the file is local
53 * and line-delimited, cheaper and more deterministic than player events). */
54const fetchCastDuration = async (url: string): Promise<number> => {
55 const text = await fetch(url).then((r) => r.text());
56 const last = text.trimEnd().split("\n").at(-1);
57 if (!last || last.startsWith("{")) return 0;
58 return (JSON.parse(last) as [number])[0] ?? 0;
59};
60
61export const SessionPlayer = ({
62 castUrl,

Callers 1

SessionPlayerFunction · 0.85

Calls 2

textMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected