feat: support categorized archives and selectable quality variants
This commit is contained in:
45 files changed
+932
-92
No files matched your search
@@ -20,6 +20,36 @@ export const OptionalLocalizedTextSchema = Type.Object(
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ReleaseWindowSchema = Type.Union([
|
||||
Type.Literal('SPRING'),
|
||||
Type.Literal('SUMMER'),
|
||||
Type.Literal('FALL'),
|
||||
Type.Literal('WINTER'),
|
||||
Type.Literal('MOVIE'),
|
||||
]);
|
||||
|
||||
const CatalogCompatibilityClassSchema = Type.Union([
|
||||
Type.Literal('COPY'),
|
||||
Type.Literal('AUDIO_TRANSCODE'),
|
||||
Type.Literal('VIDEO_TRANSCODE'),
|
||||
Type.Literal('HOLD_HDR'),
|
||||
Type.Literal('INVALID'),
|
||||
]);
|
||||
|
||||
export const MediaVariantSchema = Type.Object(
|
||||
{
|
||||
id: UuidSchema,
|
||||
label: Type.String({ minLength: 1, maxLength: 64 }),
|
||||
width: Type.Optional(Type.Integer({ minimum: 1 })),
|
||||
height: Type.Optional(Type.Integer({ minimum: 1 })),
|
||||
videoCodec: Type.Optional(Type.String({ maxLength: 64 })),
|
||||
compatibility: CatalogCompatibilityClassSchema,
|
||||
available: Type.Boolean(),
|
||||
isDefault: Type.Boolean(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const CatalogCardSchema = Type.Object(
|
||||
{
|
||||
id: UuidSchema,
|
||||
@@ -29,8 +59,12 @@ export const CatalogCardSchema = Type.Object(
|
||||
posterUrl: Type.Optional(Type.String()),
|
||||
backdropUrl: Type.Optional(Type.String()),
|
||||
year: Type.Optional(Type.Integer()),
|
||||
category: Type.Optional(Type.String({ maxLength: 100 })),
|
||||
categorySlug: Type.Optional(Type.String({ maxLength: 100 })),
|
||||
releaseWindow: Type.Optional(ReleaseWindowSchema),
|
||||
playable: Type.Boolean(),
|
||||
resumeMediaItemId: Type.Optional(UuidSchema),
|
||||
variants: Type.Optional(Type.Array(MediaVariantSchema)),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
@@ -43,14 +77,9 @@ export const MediaItemSummarySchema = Type.Object(
|
||||
episodeNumber: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
name: Type.Optional(OptionalLocalizedTextSchema),
|
||||
durationSeconds: Type.Number({ minimum: 0 }),
|
||||
compatibility: Type.Union([
|
||||
Type.Literal('COPY'),
|
||||
Type.Literal('AUDIO_TRANSCODE'),
|
||||
Type.Literal('VIDEO_TRANSCODE'),
|
||||
Type.Literal('HOLD_HDR'),
|
||||
Type.Literal('INVALID'),
|
||||
]),
|
||||
compatibility: CatalogCompatibilityClassSchema,
|
||||
published: Type.Boolean(),
|
||||
variants: Type.Optional(Type.Array(MediaVariantSchema)),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
@@ -72,8 +101,12 @@ export const TitleDetailSchema = Type.Object(
|
||||
posterUrl: Type.Optional(Type.String()),
|
||||
backdropUrl: Type.Optional(Type.String()),
|
||||
year: Type.Optional(Type.Integer()),
|
||||
category: Type.Optional(Type.String({ maxLength: 100 })),
|
||||
categorySlug: Type.Optional(Type.String({ maxLength: 100 })),
|
||||
releaseWindow: Type.Optional(ReleaseWindowSchema),
|
||||
playable: Type.Boolean(),
|
||||
resumeMediaItemId: Type.Optional(UuidSchema),
|
||||
variants: Type.Optional(Type.Array(MediaVariantSchema)),
|
||||
synopsis: OptionalLocalizedTextSchema,
|
||||
seasons: Type.Optional(Type.Array(SeasonSummarySchema)),
|
||||
mediaItems: Type.Array(MediaItemSummarySchema),
|
||||
@@ -87,6 +120,9 @@ export const CatalogQuerySchema = Type.Object(
|
||||
cursor: Type.Optional(Type.String({ maxLength: 512 })),
|
||||
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 100, default: 24 })),
|
||||
kind: Type.Optional(TitleKindSchema),
|
||||
category: Type.Optional(Type.String({ maxLength: 100 })),
|
||||
year: Type.Optional(Type.Integer({ minimum: 1888, maximum: 2200 })),
|
||||
releaseWindow: Type.Optional(ReleaseWindowSchema),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
@@ -107,6 +143,26 @@ export const CatalogResponseSchema = Type.Object(
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const CatalogSectionsQuerySchema = Type.Object(
|
||||
{ limitPerSection: Type.Optional(Type.Integer({ minimum: 1, maximum: 40, default: 12 })) },
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const CatalogSectionSchema = Type.Object(
|
||||
{
|
||||
slug: Type.String(),
|
||||
name: Type.String(),
|
||||
items: Type.Array(CatalogCardSchema),
|
||||
hasMore: Type.Boolean(),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const CatalogSectionsResponseSchema = Type.Object(
|
||||
{ sections: Type.Array(CatalogSectionSchema) },
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const SearchResponseSchema = Type.Object(
|
||||
{ items: Type.Array(CatalogCardSchema) },
|
||||
{ additionalProperties: false },
|
||||
@@ -125,10 +181,15 @@ export type TitleKind = Static<typeof TitleKindSchema>;
|
||||
export type MediaKind = Static<typeof MediaKindSchema>;
|
||||
export type LocalizedText = Static<typeof LocalizedTextSchema>;
|
||||
export type OptionalLocalizedText = Static<typeof OptionalLocalizedTextSchema>;
|
||||
export type ReleaseWindow = Static<typeof ReleaseWindowSchema>;
|
||||
export type MediaVariant = Static<typeof MediaVariantSchema>;
|
||||
export type CatalogCard = Static<typeof CatalogCardSchema>;
|
||||
export type MediaItemSummary = Static<typeof MediaItemSummarySchema>;
|
||||
export type TitleDetail = Static<typeof TitleDetailSchema>;
|
||||
export type CatalogQuery = Static<typeof CatalogQuerySchema>;
|
||||
export type SearchQuery = Static<typeof SearchQuerySchema>;
|
||||
export type CatalogResponse = Static<typeof CatalogResponseSchema>;
|
||||
export type CatalogSectionsQuery = Static<typeof CatalogSectionsQuerySchema>;
|
||||
export type CatalogSection = Static<typeof CatalogSectionSchema>;
|
||||
export type CatalogSectionsResponse = Static<typeof CatalogSectionsResponseSchema>;
|
||||
export type CatalogSnapshot = Static<typeof CatalogSnapshotSchema>;
|
||||
Reference in new issue
Block a user