Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { z } from '../z.ts';

export const lifetimeStatsQuerySchema = z.object({
lifetime_stats: z.boolean().optional().openapi({
description:
'When true, `progress.completed` and `progress.stats` reflect lifetime totals across all watches of the show. When false (default), they reflect the current watching session — i.e. counters reset by `/shows/:id/progress/watched/reset`.',
}),
});
9 changes: 8 additions & 1 deletion projects/api/src/contracts/sync/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { authMetadata, builder } from '../_internal/builder.ts';
import { bulkMediaRequestSchema } from '../_internal/request/bulkMediaRequestSchema.ts';
import { extendedQuerySchemaFactory } from '../_internal/request/extendedQuerySchemaFactory.ts';
import { lifetimeStatsQuerySchema } from '../_internal/request/lifetimeStatsQuerySchema.ts';
import { listRequestSchema } from '../_internal/request/listRequestSchema.ts';
import { pageQuerySchema } from '../_internal/request/pageQuerySchema.ts';
import { sortQuerySchema } from '../_internal/request/sortQuerySchema.ts';
Expand Down Expand Up @@ -44,7 +45,8 @@ const progress = builder.router({
query: extendedQuerySchemaFactory<['full', 'images']>()
.merge(pageQuerySchema)
.merge(sortQuerySchema)
.merge(statsQuerySchema),
.merge(statsQuerySchema)
.merge(lifetimeStatsQuerySchema),
responses: {
200: upNextResponseSchema.array(),
},
Expand Down Expand Up @@ -85,9 +87,14 @@ const progress = builder.router({
query: extendedQuerySchemaFactory<['full', 'images']>()
.merge(pageQuerySchema)
.merge(sortQuerySchema)
.merge(lifetimeStatsQuerySchema)
.merge(z.object({
hide_completed: z.boolean().optional(),
hide_not_completed: z.boolean().optional(),
only_rewatching: z.boolean().optional().openapi({
description:
'When true, restrict the list to shows the user is currently rewatching (i.e. those with an active `progress.reset_at`).',
}),
})),
responses: {
200: upNextResponseSchema.array(),
Expand Down
Loading