// A LOCAL RECORDING (a record the editor's local media import made, platform // "local", id `local-<32 hex>`) has no online source: umtool's own clip fetch // and its availability probe refuse it with the editor's sentence // (common/lib/localMedia.ts localMediaFetchRefusal), rather than run yt-dlp on // an empty URL. A local library channel's other records are refused at the // editor's doors, which umtool fetch goes through. export const LOCAL_RECORDING_ID_RE = /^local-[0-9a-f]{32}$/; /** @returns {string|null} why no clip can be fetched, or null when one may be. */ export function localRecordingFetchRefusal(videoId, platform) { const id = String(videoId ?? ""); if (platform !== "local" && !LOCAL_RECORDING_ID_RE.test(id)) return null; return `"${id}" is a local recording with no online source, so no clip can be fetched for it.`; }