diff options
Diffstat (limited to 'packages/models/src/videos/file')
4 files changed, 51 insertions, 0 deletions
diff --git a/packages/models/src/videos/file/index.ts b/packages/models/src/videos/file/index.ts new file mode 100644 index 000000000..ee06f4e20 --- /dev/null +++ b/packages/models/src/videos/file/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './video-file-metadata.model.js' | ||
2 | export * from './video-file.model.js' | ||
3 | export * from './video-resolution.enum.js' | ||
diff --git a/packages/models/src/videos/file/video-file-metadata.model.ts b/packages/models/src/videos/file/video-file-metadata.model.ts new file mode 100644 index 000000000..8f527c0a7 --- /dev/null +++ b/packages/models/src/videos/file/video-file-metadata.model.ts | |||
@@ -0,0 +1,13 @@ | |||
1 | export class VideoFileMetadata { | ||
2 | streams: { [x: string]: any, [x: number]: any }[] | ||
3 | format: { [x: string]: any, [x: number]: any } | ||
4 | chapters: any[] | ||
5 | |||
6 | constructor (hash: { chapters: any[], format: any, streams: any[] }) { | ||
7 | this.chapters = hash.chapters | ||
8 | this.format = hash.format | ||
9 | this.streams = hash.streams | ||
10 | |||
11 | delete this.format.filename | ||
12 | } | ||
13 | } | ||
diff --git a/packages/models/src/videos/file/video-file.model.ts b/packages/models/src/videos/file/video-file.model.ts new file mode 100644 index 000000000..2ed1ac4be --- /dev/null +++ b/packages/models/src/videos/file/video-file.model.ts | |||
@@ -0,0 +1,22 @@ | |||
1 | import { VideoConstant } from '../video-constant.model.js' | ||
2 | import { VideoFileMetadata } from './video-file-metadata.model.js' | ||
3 | |||
4 | export interface VideoFile { | ||
5 | id: number | ||
6 | |||
7 | resolution: VideoConstant<number> | ||
8 | size: number // Bytes | ||
9 | |||
10 | torrentUrl: string | ||
11 | torrentDownloadUrl: string | ||
12 | |||
13 | fileUrl: string | ||
14 | fileDownloadUrl: string | ||
15 | |||
16 | fps: number | ||
17 | |||
18 | metadata?: VideoFileMetadata | ||
19 | metadataUrl?: string | ||
20 | |||
21 | magnetUri: string | null | ||
22 | } | ||
diff --git a/packages/models/src/videos/file/video-resolution.enum.ts b/packages/models/src/videos/file/video-resolution.enum.ts new file mode 100644 index 000000000..434e8c36d --- /dev/null +++ b/packages/models/src/videos/file/video-resolution.enum.ts | |||
@@ -0,0 +1,13 @@ | |||
1 | export const VideoResolution = { | ||
2 | H_NOVIDEO: 0, | ||
3 | H_144P: 144, | ||
4 | H_240P: 240, | ||
5 | H_360P: 360, | ||
6 | H_480P: 480, | ||
7 | H_720P: 720, | ||
8 | H_1080P: 1080, | ||
9 | H_1440P: 1440, | ||
10 | H_4K: 2160 | ||
11 | } as const | ||
12 | |||
13 | export type VideoResolutionType = typeof VideoResolution[keyof typeof VideoResolution] | ||