mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Allow /api/shows
to be filtered by kind
This commit is contained in:
parent
16f6399c4f
commit
aa5ba7f2a9
@ -1,4 +1,4 @@
|
||||
import { type SQL, and, eq, exists, gt, ne, sql } from "drizzle-orm";
|
||||
import { and, eq, exists, gt, ne, type SQL, sql } from "drizzle-orm";
|
||||
import { db } from "~/db";
|
||||
import {
|
||||
entries,
|
||||
@ -6,10 +6,10 @@ import {
|
||||
entryVideoJoin,
|
||||
profiles,
|
||||
showStudioJoin,
|
||||
showTranslations,
|
||||
shows,
|
||||
studioTranslations,
|
||||
showTranslations,
|
||||
studios,
|
||||
studioTranslations,
|
||||
videos,
|
||||
} from "~/db/schema";
|
||||
import { watchlist } from "~/db/schema/watchlist";
|
||||
@ -26,12 +26,12 @@ import type { MovieStatus } from "~/models/movie";
|
||||
import { SerieStatus, type SerieTranslation } from "~/models/serie";
|
||||
import type { Studio } from "~/models/studio";
|
||||
import {
|
||||
buildRelations,
|
||||
type FilterDef,
|
||||
Genre,
|
||||
type Image,
|
||||
Sort,
|
||||
buildRelations,
|
||||
keysetPaginate,
|
||||
Sort,
|
||||
sortToSql,
|
||||
} from "~/models/utils";
|
||||
import type { EmbeddedVideo } from "~/models/video";
|
||||
@ -49,6 +49,11 @@ export const watchStatusQ = db
|
||||
.as("watchstatus");
|
||||
|
||||
export const showFilters: FilterDef = {
|
||||
kind: {
|
||||
column: shows.kind,
|
||||
type: "enum",
|
||||
values: ["serie", "movie", "collection"],
|
||||
},
|
||||
genres: {
|
||||
column: shows.genres,
|
||||
type: "enum",
|
||||
|
Loading…
x
Reference in New Issue
Block a user