mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Only specify kind
in movie/serie/collection in /shows
This commit is contained in:
parent
74f2229dcd
commit
3f188e27a1
@ -13,7 +13,6 @@ import {
|
||||
} from "./utils";
|
||||
|
||||
const BaseCollection = t.Object({
|
||||
kind: t.Literal("collection"),
|
||||
genres: t.Array(Genre),
|
||||
rating: t.Nullable(t.Integer({ minimum: 0, maximum: 100 })),
|
||||
startAir: t.Nullable(
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { t } from "elysia";
|
||||
import { type Prettify, comment } from "~/utils";
|
||||
import type { Prettify } from "~/utils";
|
||||
import { SeedCollection } from "./collections";
|
||||
import { bubble, bubbleImages, registerExamples } from "./examples";
|
||||
import { SeedStudio, Studio } from "./studio";
|
||||
@ -20,7 +20,6 @@ export const MovieStatus = t.UnionEnum(["unknown", "finished", "planned"]);
|
||||
export type MovieStatus = typeof MovieStatus.static;
|
||||
|
||||
const BaseMovie = t.Object({
|
||||
kind: t.Literal("movie"),
|
||||
genres: t.Array(Genre),
|
||||
rating: t.Nullable(t.Integer({ minimum: 0, maximum: 100 })),
|
||||
status: MovieStatus,
|
||||
|
@ -26,7 +26,6 @@ export const SerieStatus = t.UnionEnum([
|
||||
export type SerieStatus = typeof SerieStatus.static;
|
||||
|
||||
const BaseSerie = t.Object({
|
||||
kind: t.Literal("serie"),
|
||||
genres: t.Array(Genre),
|
||||
rating: t.Nullable(t.Integer({ minimum: 0, maximum: 100 })),
|
||||
status: SerieStatus,
|
||||
|
@ -3,4 +3,8 @@ import { Collection } from "./collections";
|
||||
import { Movie } from "./movie";
|
||||
import { Serie } from "./serie";
|
||||
|
||||
export const Show = t.Union([Movie, Serie, Collection]);
|
||||
export const Show = t.Union([
|
||||
t.Intersect([Movie, t.Object({ kind: t.Literal("movie") })]),
|
||||
t.Intersect([Serie, t.Object({ kind: t.Literal("serie") })]),
|
||||
t.Intersect([Collection, t.Object({ kind: t.Literal("collection") })]),
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user