From 409a613e435516dafd528d89bbfb176ccc8fcc65 Mon Sep 17 00:00:00 2001 From: Arthur Jamet Date: Sat, 20 Jan 2024 10:17:40 +0100 Subject: [PATCH] Front: Add Video Track Model/Validator --- .../models/src/resources/watch-info.ts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/front/packages/models/src/resources/watch-info.ts b/front/packages/models/src/resources/watch-info.ts index a058b3d5..6346c449 100644 --- a/front/packages/models/src/resources/watch-info.ts +++ b/front/packages/models/src/resources/watch-info.ts @@ -32,6 +32,39 @@ const getDisplayName = (sub: Track) => { return `Unknwon (${sub.index})`; }; +/** + * A Video track + */ +export const VideoP = z.object({ + /** + * The Codec of the Video Track. + * E.g. "AVC" + */ + codec: z.string(), + /** + * The Quality of the Video + * E.g. "1080p" (TODO: FIND ACTUAL ENUM) + */ + quality: z.string(), + /** + * The Width of the Video Frame + * E.g. 1424 + */ + width: z.number(), + /** + * The Height of the Video Frame + * E.g. 1072 + */ + height: z.number(), + /** + * The Bitrate (in bits/seconds) of the video track + * E.g. 2693245 + */ + bitrate: z.number() +}) + +export type Video = z.infer; + /** * A audio or subtitle track. */ @@ -122,6 +155,10 @@ export const WatchInfoP = z.object({ * The container of the video file of this episode. Common containers are mp4, mkv, avi and so on. */ container: z.string(), + /** + * The video track. + */ + video: VideoP, /** * The list of audio tracks. */