mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add percent in movie's watchlist
This commit is contained in:
parent
32cc6e7910
commit
be35a4f0d9
@ -250,7 +250,10 @@ export async function getShows({
|
||||
.as("t");
|
||||
|
||||
const watchStatusQ = db
|
||||
.select()
|
||||
.select({
|
||||
...getColumns(watchlist),
|
||||
percent: watchlist.seenCount,
|
||||
})
|
||||
.from(watchlist)
|
||||
.where(eq(watchlist.profilePk, userId))
|
||||
.as("watchstatus");
|
||||
|
@ -9,8 +9,8 @@ import {
|
||||
TranslationRecord,
|
||||
} from "../utils";
|
||||
import { EmbeddedVideo } from "../video";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
import { Progress } from "../watchlist";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
|
||||
export const BaseEpisode = t.Intersect([
|
||||
t.Object({
|
||||
|
@ -3,8 +3,8 @@ import { type Prettify, comment } from "~/utils";
|
||||
import { madeInAbyss, registerExamples } from "../examples";
|
||||
import { DbMetadata, SeedImage } from "../utils";
|
||||
import { Resource } from "../utils/resource";
|
||||
import { BaseEntry } from "./base-entry";
|
||||
import { Progress } from "../watchlist";
|
||||
import { BaseEntry } from "./base-entry";
|
||||
|
||||
export const ExtraType = t.UnionEnum([
|
||||
"other",
|
||||
|
@ -10,8 +10,8 @@ import {
|
||||
TranslationRecord,
|
||||
} from "../utils";
|
||||
import { EmbeddedVideo } from "../video";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
import { Progress } from "../watchlist";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
|
||||
export const BaseMovieEntry = t.Intersect(
|
||||
[
|
||||
|
@ -9,8 +9,8 @@ import {
|
||||
TranslationRecord,
|
||||
} from "../utils";
|
||||
import { EmbeddedVideo } from "../video";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
import { Progress } from "../watchlist";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
|
||||
export const BaseSpecial = t.Intersect(
|
||||
[
|
||||
|
@ -71,7 +71,7 @@ export const Serie = t.Intersect([
|
||||
availableCount: t.Integer({
|
||||
description: "The number of episodes that can be played right away",
|
||||
}),
|
||||
watchStatus: WatchStatus,
|
||||
watchStatus: t.Omit(WatchStatus, ["percent"]),
|
||||
}),
|
||||
]);
|
||||
export type Serie = Prettify<typeof Serie.static>;
|
||||
|
@ -41,8 +41,14 @@ export const WatchStatus = t.Object({
|
||||
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" })),
|
||||
// only for series
|
||||
seenCount: t.Integer({
|
||||
description: "The number of episodes you watched in this serie.",
|
||||
minimum: 0,
|
||||
}),
|
||||
// only for movies
|
||||
percent: t.Integer({
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
}),
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user