Add studios and staff filters for shows

This commit is contained in:
Zoe Roux 2026-03-29 12:16:50 +02:00
parent d464e1192c
commit 0f31286058
No known key found for this signature in database

View File

@ -5,9 +5,11 @@ import {
entries,
entryVideoJoin,
profiles,
roles,
showStudioJoin,
shows,
showTranslations,
staff,
studios,
studioTranslations,
videos,
@ -92,6 +94,24 @@ export const showFilters: FilterDef = {
type: "int",
},
nextRefresh: { column: shows.nextRefresh, type: "date" },
studios: {
column: db
.select({ slug: studios.slug })
.from(showStudioJoin)
.innerJoin(studios, eq(studios.pk, showStudioJoin.studioPk))
.where(eq(showStudioJoin.showPk, shows.pk)),
type: "string",
isArray: true,
},
staff: {
column: db
.select({ slug: staff.slug })
.from(roles)
.innerJoin(staff, eq(staff.pk, roles.staffPk))
.where(eq(roles.showPk, shows.pk)),
type: "string",
isArray: true,
},
};
export const showSort = Sort(
{