mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-21 14:46:29 -04:00
Add watch status type in movies/series
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
} from "./utils";
|
||||
import { Original } from "./utils/original";
|
||||
import { EmbeddedVideo } from "./video";
|
||||
import { WatchStatus } from "./watchlist";
|
||||
|
||||
export const MovieStatus = t.UnionEnum(["unknown", "finished", "planned"]);
|
||||
export type MovieStatus = typeof MovieStatus.static;
|
||||
@@ -55,6 +56,7 @@ export const Movie = t.Intersect([
|
||||
t.Object({
|
||||
original: Original,
|
||||
isAvailable: t.Boolean(),
|
||||
watchStatus: t.Omit(WatchStatus, ["seenCount"]),
|
||||
}),
|
||||
]);
|
||||
export type Movie = Prettify<typeof Movie.static>;
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
TranslationRecord,
|
||||
} from "./utils";
|
||||
import { Original } from "./utils/original";
|
||||
import { WatchStatus } from "./watchlist";
|
||||
|
||||
export const SerieStatus = t.UnionEnum([
|
||||
"unknown",
|
||||
@@ -70,6 +71,7 @@ export const Serie = t.Intersect([
|
||||
availableCount: t.Integer({
|
||||
description: "The number of episodes that can be played right away",
|
||||
}),
|
||||
watchStatus: WatchStatus,
|
||||
}),
|
||||
]);
|
||||
export type Serie = Prettify<typeof Serie.static>;
|
||||
|
||||
@@ -27,3 +27,22 @@ export const Progress = t.Object({
|
||||
),
|
||||
});
|
||||
export type Progress = typeof Progress.static;
|
||||
|
||||
export const WatchlistStatus = t.UnionEnum([
|
||||
"completed",
|
||||
"watching",
|
||||
"rewatching",
|
||||
"dropped",
|
||||
"planned",
|
||||
]);
|
||||
|
||||
export const WatchStatus = t.Object({
|
||||
status: WatchlistStatus,
|
||||
score: t.Nullable(t.Integer({ minimum: 0, maximum: 100 })),
|
||||
startedAt: t.Nullable(t.String({ format: "date-time" })),
|
||||
completedAt: t.Nullable(t.String({ format: "date-time" })),
|
||||
seenCount: t.Integer({
|
||||
description: "The number of episodes you watched in this serie.",
|
||||
minimum: 0,
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user