Front: Add Video Track Model/Validator

This commit is contained in:
Arthur Jamet 2024-01-20 10:17:40 +01:00 committed by Zoe Roux
parent 14da738cc8
commit 409a613e43

View File

@ -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<typeof VideoP>;
/**
* 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.
*/