mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Add show type
This commit is contained in:
parent
6823642e33
commit
9498dea3fd
@ -4,6 +4,7 @@ export * from "./kyoo-error";
|
|||||||
export * from "./movie";
|
export * from "./movie";
|
||||||
export * from "./serie";
|
export * from "./serie";
|
||||||
export * from "./collection";
|
export * from "./collection";
|
||||||
|
export * from "./show";
|
||||||
export * from "./entry";
|
export * from "./entry";
|
||||||
export * from "./studio";
|
export * from "./studio";
|
||||||
export * from "./video";
|
export * from "./video";
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
import { z } from "zod";
|
|
||||||
import { CollectionP } from "./collection";
|
|
||||||
import { MovieP } from "./movie";
|
|
||||||
import { ShowP } from "./show";
|
|
||||||
|
|
||||||
export const LibraryItemP = z.union([
|
|
||||||
/*
|
|
||||||
* Either a Show
|
|
||||||
*/
|
|
||||||
ShowP,
|
|
||||||
/*
|
|
||||||
* Or a Movie
|
|
||||||
*/
|
|
||||||
MovieP,
|
|
||||||
/*
|
|
||||||
* Or a Collection
|
|
||||||
*/
|
|
||||||
CollectionP,
|
|
||||||
]);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An item that can be contained by a Library (so a Show, a Movie or a Collection).
|
|
||||||
*/
|
|
||||||
export type LibraryItem = z.infer<typeof LibraryItemP>;
|
|
10
front/src/models/show.ts
Normal file
10
front/src/models/show.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import z from "zod";
|
||||||
|
import { Collection } from "./collection";
|
||||||
|
import { Movie } from "./movie";
|
||||||
|
import { Serie } from "./serie";
|
||||||
|
|
||||||
|
export const Show = z.union([
|
||||||
|
Serie.and(z.object({ kind: z.literal("serie") })),
|
||||||
|
Movie.and(z.object({ kind: z.literal("movie") })),
|
||||||
|
Collection.and(z.object({ kind: z.literal("collection") })),
|
||||||
|
]);
|
Loading…
x
Reference in New Issue
Block a user