feat(web): surface discover.listenBrainzUrl; swap maxSeeds->chunkSize in Discovery tab
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user