Add friendly scrape names and a completeness check

This commit is contained in:
Fisto
2026-09-21 10:40:53 +02:00
parent 19bf6e16fc
commit 3bba051971
7 changed files with 219 additions and 8 deletions
+11
View File
@@ -657,6 +657,17 @@ export class ScrapeStore {
.run(preview.hash, preview.bytes, preview.ext ?? "webp", id);
}
/** Message span of the walk, for completeness checks. */
dbSummary(): { messages: number; oldest: string | null; newest: string | null } {
const row = this.db
.prepare(
"SELECT COUNT(*) AS messages, MIN(timestamp) AS oldest, MAX(timestamp) AS newest FROM messages"
)
.get() as { messages: number; oldest: string | null; newest: string | null } | undefined;
return { messages: row?.messages ?? 0, oldest: row?.oldest ?? null, newest: row?.newest ?? null };
}
/** Preview state for the whole scrape and per kind, for the backfill UI. */
previewCounts(): {
total: number;