Files
netfelix-audio-fix/server/api/dashboard.ts
T
felixfoertsch 2701441a1c
Build and Push Docker Image / build (push) Successful in 1m40s
background processing with stop, simplify pipeline header stats, remove inbox skip
- processInbox runs in background, returns immediately, items appear in
  columns progressively via SSE-triggered reloads
- stop button aborts mid-run, processed items stay in their destination
- fix language resolver: resolve series TVDB before sonarrLang HTTP fallback
- remove skip/skip-all from inbox (not meaningful in process-based flow)
- pipeline header shows only: total, needs action, queued, errors
- fix column header height jitter with fixed subtitle slot height

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 10:06:44 +02:00

28 lines
884 B
TypeScript

import { Hono } from "hono";
import { getConfig, getDb } from "../db/index";
const app = new Hono();
app.get("/", (c) => {
const db = getDb();
const totalItems = (db.prepare("SELECT COUNT(*) as n FROM media_items").get() as { n: number }).n;
const needsAction = (
db.prepare("SELECT COUNT(*) as n FROM review_plans WHERE status = 'pending' AND is_noop = 0").get() as { n: number }
).n;
const queued = (
db.prepare("SELECT COUNT(*) as n FROM jobs WHERE status = 'pending'").get() as { n: number }
).n;
const errors = (db.prepare("SELECT COUNT(*) as n FROM review_plans WHERE status = 'error'").get() as { n: number }).n;
const scanRunning = getConfig("scan_running") === "1";
const setupComplete = getConfig("setup_complete") === "1";
return c.json({
stats: { totalItems, needsAction, queued, errors },
scanRunning,
setupComplete,
});
});
export default app;