mirror of
https://github.com/p-stream/backend.git
synced 2026-05-13 11:00:37 +00:00
fix import errors
This commit is contained in:
parent
0bafca2082
commit
eb2cb15c43
1 changed files with 4 additions and 4 deletions
|
|
@ -8,15 +8,15 @@ const log = scopedLogger('progress-import');
|
||||||
const progressMetaSchema = z.object({
|
const progressMetaSchema = z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
type: z.enum(['movie', 'show']),
|
type: z.enum(['movie', 'show']),
|
||||||
year: z.number(),
|
year: z.number().optional(),
|
||||||
poster: z.string().optional(),
|
poster: z.string().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const progressItemSchema = z.object({
|
const progressItemSchema = z.object({
|
||||||
meta: progressMetaSchema,
|
meta: progressMetaSchema,
|
||||||
tmdbId: z.string(),
|
tmdbId: z.string().transform(val => val || randomUUID()),
|
||||||
duration: z.number().min(0),
|
duration: z.number().min(0).transform(n => Math.round(n)),
|
||||||
watched: z.number().min(0),
|
watched: z.number().min(0).transform(n => Math.round(n)),
|
||||||
seasonId: z.string().optional(),
|
seasonId: z.string().optional(),
|
||||||
episodeId: z.string().optional(),
|
episodeId: z.string().optional(),
|
||||||
seasonNumber: z.number().optional(),
|
seasonNumber: z.number().optional(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue