feat(web): surface discover.listenBrainzUrl; swap maxSeeds->chunkSize in Discovery tab

This commit is contained in:
Jonathan
2026-07-13 00:33:49 +02:00
parent 98735b5353
commit fd0bb6aaa0
3 changed files with 12 additions and 6 deletions
@@ -13,17 +13,17 @@ describe("discover config API", () => {
const body = await (await GET()).json();
expect(body).toMatchObject({
"discover.enabled": "false", "discover.intervalHours": "168",
"discover.maxSeeds": "50", "discover.similarPerSeed": "20",
"discover.albumsPerArtist": "1", "discover.minScore": "0",
"discover.similarPerSeed": "20", "discover.albumsPerArtist": "1",
"discover.minScore": "0", "discover.chunkSize": "5", "discover.listenBrainzUrl": "",
});
});
it("PATCH upserts known keys and ignores unknown ones", async () => {
const res = await patch({ "discover.enabled": "true", "discover.maxSeeds": 25, "nope": "x" });
const res = await patch({ "discover.enabled": "true", "discover.chunkSize": 25, "nope": "x" });
expect((await res.json()).updated).toBe(2);
const body = await (await GET()).json();
expect(body["discover.enabled"]).toBe("true");
expect(body["discover.maxSeeds"]).toBe("25");
expect(body["discover.chunkSize"]).toBe("25");
expect(await prisma.config.findUnique({ where: { key: "nope" } })).toBeNull();
});
});
+2 -1
View File
@@ -3,10 +3,11 @@ import { prisma } from "@/lib/db";
const DEFAULTS: Record<string, string> = {
"discover.enabled": "false",
"discover.intervalHours": "168",
"discover.maxSeeds": "50",
"discover.similarPerSeed": "20",
"discover.albumsPerArtist": "1",
"discover.minScore": "0",
"discover.chunkSize": "5",
"discover.listenBrainzUrl": "",
};
export async function GET() {