commit 828d71c124c2923ee978fb0d7d3dc07092daeee5
parent 67dbaa8d701d5a5f254456667c55061607c99507
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 11 Nov 2026 06:54:20 -0500
report refresh: a local media library channel's sync is a routine skip
Review should-fix (check runners on a URL-less channel). The swept runners
leave a Local Archive channel alone: the scheduler and Sync all drop a channel
with no URL, its download and transcription buckets are empty, and the URL
resolvers answer null rather than build youtube.com/watch?v=local-... . The
one runner that asked anyway was the report-refresh lane, which syncs every
channel a report cites: a refused sync per local channel per run. It is now a
routine skip ("a local media library: nothing online to sync"), no job, no
warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat:
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/common/controller/reportRefresh.ts b/common/controller/reportRefresh.ts
@@ -303,7 +303,8 @@ export function fetchHooksOf(deps: ReportDraftDeps): FetchHooks {
const c = (await configs()).get(slug);
if (!c) return null;
const platform = platformOfConfig(c);
- return { kind: isPostsChannel(c) ? "posts" : "video", ...(platform ? { platform } : {}) };
+ const localLibrary = !!c.localMedia && !(typeof c.url === "string" && c.url.trim());
+ return { kind: isPostsChannel(c) ? "posts" : "video", ...(platform ? { platform } : {}), ...(localLibrary ? { localLibrary: true as const } : {}) };
},
platformRefusal: (platform) => platformRefusalOf(platform, paths),
bucketOf: async (slug) => {
diff --git a/common/lib/report/draft/refresh/fetch.ts b/common/lib/report/draft/refresh/fetch.ts
@@ -30,7 +30,9 @@ export type RefreshHooks = {
editor: ResearchEditor;
jobOf: JobOf;
// A channel of this editor: what it is and on which platform; null: none.
- channelOf: (slug: string) => Promise<{ kind: "video" | "posts"; platform?: string } | null>;
+ // `localLibrary`: a local media library channel (a library, no URL) —
+ // nothing online to sync, so its sync is a routine skip.
+ channelOf: (slug: string) => Promise<{ kind: "video" | "posts"; platform?: string; localLibrary?: true } | null>;
// Why a fetch on this platform would be refused now (held, cooling down), or null.
platformRefusal?: (platform: string) => Promise<string | null>;
// A channel's "downloaded, not transcribed" recordings (its report's bucket), or null.
@@ -169,6 +171,7 @@ export async function fetchAndBuild(
const fetchChannel = async (slug: string): Promise<FetchStep[]> => {
const ch = await hooks.channelOf(slug).catch(() => null);
if (!ch) return [skip(slug, "sync", "not a channel of this editor")];
+ if (ch.localLibrary) return [skip(slug, "sync", "a local media library: nothing online to sync", true)];
const first = ch.kind === "posts" ? "fetch-posts" : "sync";
if (ch.platform && hooks.platformRefusal) {
const no = await hooks.platformRefusal(ch.platform).catch(() => null);
diff --git a/common/lib/report/draft/refresh/refresh.test.ts b/common/lib/report/draft/refresh/refresh.test.ts
@@ -536,3 +536,21 @@ test("R4.1 fetch: transcription held — transcribe-bucket is skipped and said (
assert.ok(r.warnings.some((w) => /^gone: sync cancelled — the job ended cancelled$/.test(w)), JSON.stringify(r.warnings));
assert.ok(!r.warnings.some((w) => /nothing new to transcribe/.test(w)));
});
+
+// lane/local-media: a local media library channel has nothing online to sync —
+// a routine skip, no job and no warning (it used to be a refused sync).
+test("fetch: a local media library channel's sync is a routine skip, not a refused job", async () => {
+ const calls: Call[] = [];
+ const hooks = {
+ editor: { async run(action: string, args: Record<string, unknown>) { calls.push({ action, args }); return { ok: true, jobId: "j" }; } },
+ jobOf: async () => ({ status: "done", endedAt: Date.now() }),
+ channelOf: async () => ({ kind: "video" as const, localLibrary: true as const }),
+ siteOf: async () => ({ site: null, reason: "no build" }),
+ pollMs: 1,
+ sleep: async () => {},
+ };
+ const r = await fetchAndBuild({ channels: ["library"] }, hooks);
+ assert.deepEqual(calls, []);
+ assert.deepEqual(r.fetch, [{ channel: "library", action: "sync", status: "skipped", reason: "a local media library: nothing online to sync", routine: true }]);
+ assert.deepEqual(r.warnings, []);
+});