mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-08-07 09:01:29 -04:00
Make history's time
non nullable (it was never null anyways)
This commit is contained in:
parent
4fb1406f2b
commit
bc8e87f343
@ -18,7 +18,7 @@ export const history = schema.table(
|
|||||||
.references(() => entries.pk, { onDelete: "cascade" }),
|
.references(() => entries.pk, { onDelete: "cascade" }),
|
||||||
videoPk: integer().references(() => videos.pk, { onDelete: "set null" }),
|
videoPk: integer().references(() => videos.pk, { onDelete: "set null" }),
|
||||||
percent: integer().notNull().default(0),
|
percent: integer().notNull().default(0),
|
||||||
time: integer(),
|
time: integer().notNull().default(0),
|
||||||
playedDate: timestamp({ withTimezone: true, mode: "iso" })
|
playedDate: timestamp({ withTimezone: true, mode: "iso" })
|
||||||
.notNull()
|
.notNull()
|
||||||
.default(sql`now()`),
|
.default(sql`now()`),
|
||||||
|
@ -3,15 +3,13 @@ import { comment } from "~/utils";
|
|||||||
|
|
||||||
export const Progress = t.Object({
|
export const Progress = t.Object({
|
||||||
percent: t.Integer({ minimum: 0, maximum: 100 }),
|
percent: t.Integer({ minimum: 0, maximum: 100 }),
|
||||||
time: t.Nullable(
|
time: t.Integer({
|
||||||
t.Integer({
|
minimum: 0,
|
||||||
minimum: 0,
|
description: comment`
|
||||||
description: comment`
|
|
||||||
When this episode was stopped (in seconds since the start).
|
When this episode was stopped (in seconds since the start).
|
||||||
This value is null if the entry was never watched or is finished.
|
This value is null if the entry was never watched or is finished.
|
||||||
`,
|
`,
|
||||||
}),
|
}),
|
||||||
),
|
|
||||||
playedDate: t.Nullable(t.String({ format: "date-time" })),
|
playedDate: t.Nullable(t.String({ format: "date-time" })),
|
||||||
videoId: t.Nullable(
|
videoId: t.Nullable(
|
||||||
t.String({
|
t.String({
|
||||||
|
@ -29,7 +29,7 @@ const Base = z.object({
|
|||||||
),
|
),
|
||||||
progress: z.object({
|
progress: z.object({
|
||||||
percent: z.int().min(0).max(100),
|
percent: z.int().min(0).max(100),
|
||||||
time: z.int().min(0).nullable(),
|
time: z.int().min(0),
|
||||||
playedDate: zdate().nullable(),
|
playedDate: zdate().nullable(),
|
||||||
videoId: z.string().nullable(),
|
videoId: z.string().nullable(),
|
||||||
}),
|
}),
|
||||||
|
@ -22,7 +22,7 @@ export const Extra = z.object({
|
|||||||
|
|
||||||
progress: z.object({
|
progress: z.object({
|
||||||
percent: z.int().min(0).max(100),
|
percent: z.int().min(0).max(100),
|
||||||
time: z.int().min(0).nullable(),
|
time: z.int().min(0),
|
||||||
playedDate: zdate().nullable(),
|
playedDate: zdate().nullable(),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
@ -39,7 +39,7 @@ export const FullVideo = Video.extend({
|
|||||||
slugs: z.array(z.string()),
|
slugs: z.array(z.string()),
|
||||||
progress: z.object({
|
progress: z.object({
|
||||||
percent: z.int().min(0).max(100),
|
percent: z.int().min(0).max(100),
|
||||||
time: z.int().min(0).nullable(),
|
time: z.int().min(0),
|
||||||
playedDate: zdate().nullable(),
|
playedDate: zdate().nullable(),
|
||||||
videoId: z.string().nullable(),
|
videoId: z.string().nullable(),
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user