fix(discover): dismissing an artist also dismisses its albums

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan
2026-07-14 23:43:30 +02:00
parent 202fc0db3c
commit a8c1600111
2 changed files with 22 additions and 0 deletions
@@ -63,6 +63,20 @@ describe("discover action API", () => {
expect((await prisma.discoverySuggestion.findUnique({ where: { id: s.id } }))!.status).toBe("followed");
});
it("dismissing an artist also dismisses its pending album suggestions", async () => {
const a = await prisma.discoverySuggestion.create({
data: { kind: "artist", artistMbid: "shared", artistName: "Cand", score: 1, seedCount: 1,
sources: ["listenbrainz"], secondaryTypes: [], dedupeKey: "artist:shared:" },
});
const alb = await prisma.discoverySuggestion.create({
data: { kind: "album", artistMbid: "shared", artistName: "Cand", rgMbid: "rgS", album: "Rec",
albumReason: "newest", score: 1, seedCount: 1, sources: ["listenbrainz"],
secondaryTypes: [], dedupeKey: "album:shared:rgS" },
});
await post(a.id, { action: "dismiss" });
expect((await prisma.discoverySuggestion.findUnique({ where: { id: alb.id } }))!.status).toBe("dismissed");
});
it("want upserts a monitored release from the suggestion and marks wanted", async () => {
const s = await album("rgW");
const res = await post(s.id, { action: "want" });