- execute: actually call isInScheduleWindow/waitForWindow/sleepBetweenJobs in runSequential (they were dead code); emit queue_status SSE events (running/paused/sleeping/idle) so the pipeline's existing QueueStatus listener lights up - review: POST /:id/retry resets an errored plan to approved, wipes old done/error jobs, rebuilds command from current decisions, queues fresh job - scan: dev-mode DELETE now also wipes jobs + subtitle_files (previously orphaned after every dev reset) - biome: migrate config to 2.4 schema, autoformat 68 files (strings + indentation), relax opinionated a11y/hooks-deps/index-key rules that don't fit this codebase - routeTree.gen.ts regenerated after /nodes removal
36 lines
780 B
TypeScript
36 lines
780 B
TypeScript
import { existsSync } from "node:fs";
|
|
import { Hono } from "hono";
|
|
import { getDb } from "../db/index";
|
|
|
|
const app = new Hono();
|
|
|
|
interface PathInfo {
|
|
prefix: string;
|
|
itemCount: number;
|
|
accessible: boolean;
|
|
}
|
|
|
|
app.get("/", (c) => {
|
|
const db = getDb();
|
|
const rows = db
|
|
.query<{ prefix: string; count: number }, []>(
|
|
`SELECT substr(file_path, 1, instr(substr(file_path, 2), '/') + 1) AS prefix,
|
|
COUNT(*) AS count
|
|
FROM media_items
|
|
WHERE file_path IS NOT NULL AND file_path != ''
|
|
GROUP BY prefix
|
|
ORDER BY prefix`,
|
|
)
|
|
.all();
|
|
|
|
const paths: PathInfo[] = rows.map((r: { prefix: string; count: number }) => ({
|
|
prefix: r.prefix,
|
|
itemCount: r.count,
|
|
accessible: existsSync(r.prefix),
|
|
}));
|
|
|
|
return c.json({ paths });
|
|
});
|
|
|
|
export default app;
|