Release 0.15.1: schedule for the models folder scan
Release / release (push) Successful in 3m49s

Settings -> Downloads lets you scan the models folder every 2 minutes
(default, as before), hourly, daily, weekly, monthly at a chosen local
time, or only manually, with a Scan now button and the last/next scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-27 16:42:56 +01:00
1 parent 276108932d
commit c6bcb514e6
14 files changed
+1940 -12

No files matched your search

+5 -3
View File
@@ -2,20 +2,21 @@ import { NextResponse } from "next/server";
import { z } from "zod";
import { withAuth } from "@/lib/api-auth";
import { apiError, handleApiError } from "@/lib/api-errors";
import { getDownloadSpeedLimit, getRecommendedRoles, saveDownloadSpeedLimit, saveRecommendedRoles, SettingsError } from "@/lib/settings";
import { getDownloadSpeedLimit, getRecommendedRoles, getScanStatus, saveDownloadSpeedLimit, saveRecommendedRoles, saveScanSchedule, SettingsError } from "@/lib/settings";
export const dynamic = "force-dynamic";
async function current() {
return { recommendedRoles: await getRecommendedRoles(), maxBytesPerSecond: await getDownloadSpeedLimit() };
return { recommendedRoles: await getRecommendedRoles(), maxBytesPerSecond: await getDownloadSpeedLimit(), scan: await getScanStatus() };
}
/** Download settings: which file kinds are picked along with model weights, and the speed limit. */
/** Download settings: which file kinds are picked along with model weights, the speed limit, and the models folder scan. */
export const GET = withAuth(async () => NextResponse.json(await current()));
const Body = z.object({
recommendedRoles: z.array(z.string()).max(32).optional(),
maxBytesPerSecond: z.number().nullable().optional(),
scanSchedule: z.unknown().optional(),
});
export const PUT = withAuth(async (req) => {
@@ -23,6 +24,7 @@ export const PUT = withAuth(async (req) => {
const body = Body.parse(await req.json());
if (body.recommendedRoles) await saveRecommendedRoles(body.recommendedRoles);
if (body.maxBytesPerSecond !== undefined) await saveDownloadSpeedLimit(body.maxBytesPerSecond);
if (body.scanSchedule !== undefined) await saveScanSchedule(body.scanSchedule);
return NextResponse.json(await current());
} catch (err) {
if (err instanceof SettingsError) return apiError(err.status, err.code, err.message);