mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-30 19:54:16 -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");
|
.as("t");
|
||||||
|
|
||||||
const watchStatusQ = db
|
const watchStatusQ = db
|
||||||
.select()
|
.select({
|
||||||
|
...getColumns(watchlist),
|
||||||
|
percent: watchlist.seenCount,
|
||||||
|
})
|
||||||
.from(watchlist)
|
.from(watchlist)
|
||||||
.where(eq(watchlist.profilePk, userId))
|
.where(eq(watchlist.profilePk, userId))
|
||||||
.as("watchstatus");
|
.as("watchstatus");
|
||||||
|
@ -9,8 +9,8 @@ import {
|
|||||||
TranslationRecord,
|
TranslationRecord,
|
||||||
} from "../utils";
|
} from "../utils";
|
||||||
import { EmbeddedVideo } from "../video";
|
import { EmbeddedVideo } from "../video";
|
||||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
|
||||||
import { Progress } from "../watchlist";
|
import { Progress } from "../watchlist";
|
||||||
|
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||||
|
|
||||||
export const BaseEpisode = t.Intersect([
|
export const BaseEpisode = t.Intersect([
|
||||||
t.Object({
|
t.Object({
|
||||||
|
@ -3,8 +3,8 @@ import { type Prettify, comment } from "~/utils";
|
|||||||
import { madeInAbyss, registerExamples } from "../examples";
|
import { madeInAbyss, registerExamples } from "../examples";
|
||||||
import { DbMetadata, SeedImage } from "../utils";
|
import { DbMetadata, SeedImage } from "../utils";
|
||||||
import { Resource } from "../utils/resource";
|
import { Resource } from "../utils/resource";
|
||||||
import { BaseEntry } from "./base-entry";
|
|
||||||
import { Progress } from "../watchlist";
|
import { Progress } from "../watchlist";
|
||||||
|
import { BaseEntry } from "./base-entry";
|
||||||
|
|
||||||
export const ExtraType = t.UnionEnum([
|
export const ExtraType = t.UnionEnum([
|
||||||
"other",
|
"other",
|
||||||
|
@ -10,8 +10,8 @@ import {
|
|||||||
TranslationRecord,
|
TranslationRecord,
|
||||||
} from "../utils";
|
} from "../utils";
|
||||||
import { EmbeddedVideo } from "../video";
|
import { EmbeddedVideo } from "../video";
|
||||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
|
||||||
import { Progress } from "../watchlist";
|
import { Progress } from "../watchlist";
|
||||||
|
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||||
|
|
||||||
export const BaseMovieEntry = t.Intersect(
|
export const BaseMovieEntry = t.Intersect(
|
||||||
[
|
[
|
||||||
|
@ -9,8 +9,8 @@ import {
|
|||||||
TranslationRecord,
|
TranslationRecord,
|
||||||
} from "../utils";
|
} from "../utils";
|
||||||
import { EmbeddedVideo } from "../video";
|
import { EmbeddedVideo } from "../video";
|
||||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
|
||||||
import { Progress } from "../watchlist";
|
import { Progress } from "../watchlist";
|
||||||
|
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||||
|
|
||||||
export const BaseSpecial = t.Intersect(
|
export const BaseSpecial = t.Intersect(
|
||||||
[
|
[
|
||||||
|
@ -71,7 +71,7 @@ export const Serie = t.Intersect([
|
|||||||
availableCount: t.Integer({
|
availableCount: t.Integer({
|
||||||
description: "The number of episodes that can be played right away",
|
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>;
|
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 })),
|
score: t.Nullable(t.Integer({ minimum: 0, maximum: 100 })),
|
||||||
startedAt: t.Nullable(t.String({ format: "date-time" })),
|
startedAt: t.Nullable(t.String({ format: "date-time" })),
|
||||||
completedAt: t.Nullable(t.String({ format: "date-time" })),
|
completedAt: t.Nullable(t.String({ format: "date-time" })),
|
||||||
|
// only for series
|
||||||
seenCount: t.Integer({
|
seenCount: t.Integer({
|
||||||
description: "The number of episodes you watched in this serie.",
|
description: "The number of episodes you watched in this serie.",
|
||||||
minimum: 0,
|
minimum: 0,
|
||||||
}),
|
}),
|
||||||
|
// only for movies
|
||||||
|
percent: t.Integer({
|
||||||
|
minimum: 0,
|
||||||
|
maximum: 100,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user