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.).
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "WatchedArtist" ADD COLUMN "showAllTypes" BOOLEAN NOT NULL DEFAULT false;
|
||||||
@@ -97,6 +97,7 @@ model WatchedArtist {
|
|||||||
mbid String @unique
|
mbid String @unique
|
||||||
name String
|
name String
|
||||||
autoMonitorFuture Boolean @default(false)
|
autoMonitorFuture Boolean @default(false)
|
||||||
|
showAllTypes Boolean @default(false)
|
||||||
monitorFrom DateTime @default(now())
|
monitorFrom DateTime @default(now())
|
||||||
lastPolledAt DateTime?
|
lastPolledAt DateTime?
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user