From f2dbef047cae0f726a1bbfd778ab666d56c1f25c Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 11 Jul 2026 18:03:29 +0200 Subject: [PATCH] feat: WatchedArtist.showAllTypes toggle (default false) Adds the per-artist release-type filter toggle: off (default) restricts a discography view to core studio releases, on shows everything (live, compilations, etc.). --- .../migration.sql | 2 ++ web/prisma/schema.prisma | 1 + worker/tests/test_watched_artist_show_all_types.py | 11 +++++++++++ 3 files changed, 14 insertions(+) create mode 100644 web/prisma/migrations/20260711160249_watched_artist_show_all_types/migration.sql create mode 100644 worker/tests/test_watched_artist_show_all_types.py diff --git a/web/prisma/migrations/20260711160249_watched_artist_show_all_types/migration.sql b/web/prisma/migrations/20260711160249_watched_artist_show_all_types/migration.sql new file mode 100644 index 0000000..9ec6d92 --- /dev/null +++ b/web/prisma/migrations/20260711160249_watched_artist_show_all_types/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "WatchedArtist" ADD COLUMN "showAllTypes" BOOLEAN NOT NULL DEFAULT false; diff --git a/web/prisma/schema.prisma b/web/prisma/schema.prisma index ebac747..404e3c4 100644 --- a/web/prisma/schema.prisma +++ b/web/prisma/schema.prisma @@ -97,6 +97,7 @@ model WatchedArtist { mbid String @unique name String autoMonitorFuture Boolean @default(false) + showAllTypes Boolean @default(false) monitorFrom DateTime @default(now()) lastPolledAt DateTime? createdAt DateTime @default(now()) diff --git a/worker/tests/test_watched_artist_show_all_types.py b/worker/tests/test_watched_artist_show_all_types.py new file mode 100644 index 0000000..afa432e --- /dev/null +++ b/worker/tests/test_watched_artist_show_all_types.py @@ -0,0 +1,11 @@ +def test_watched_artist_show_all_types_defaults_false(conn): + with conn.cursor() as cur: + cur.execute( + 'INSERT INTO "WatchedArtist" (id, mbid, name, "createdAt") ' + "VALUES (gen_random_uuid()::text, 'm1', 'X', now()) RETURNING id" + ) + aid = cur.fetchone()[0] + conn.commit() + with conn.cursor() as cur: + cur.execute('SELECT "showAllTypes" FROM "WatchedArtist" WHERE id = %s', (aid,)) + assert cur.fetchone()[0] is False