diff options
Diffstat (limited to 'shared/models/videos/file')
-rw-r--r-- | shared/models/videos/file/index.ts | 3 | ||||
-rw-r--r-- | shared/models/videos/file/video-file-metadata.model.ts | 13 | ||||
-rw-r--r-- | shared/models/videos/file/video-file.model.ts | 21 | ||||
-rw-r--r-- | shared/models/videos/file/video-resolution.enum.ts | 11 |
4 files changed, 48 insertions, 0 deletions
diff --git a/shared/models/videos/file/index.ts b/shared/models/videos/file/index.ts new file mode 100644 index 000000000..78a784a3c --- /dev/null +++ b/shared/models/videos/file/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './video-file-metadata.model' | ||
2 | export * from './video-file.model' | ||
3 | export * from './video-resolution.enum' | ||
diff --git a/shared/models/videos/file/video-file-metadata.model.ts b/shared/models/videos/file/video-file-metadata.model.ts new file mode 100644 index 000000000..8f527c0a7 --- /dev/null +++ b/shared/models/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/shared/models/videos/file/video-file.model.ts b/shared/models/videos/file/video-file.model.ts new file mode 100644 index 000000000..0ea857e7a --- /dev/null +++ b/shared/models/videos/file/video-file.model.ts | |||
@@ -0,0 +1,21 @@ | |||
1 | import { VideoConstant } from '../video-constant.model' | ||
2 | import { VideoFileMetadata } from './video-file-metadata.model' | ||
3 | import { VideoResolution } from './video-resolution.enum' | ||
4 | |||
5 | export interface VideoFile { | ||
6 | resolution: VideoConstant<VideoResolution> | ||
7 | size: number // Bytes | ||
8 | |||
9 | torrentUrl: string | ||
10 | torrentDownloadUrl: string | ||
11 | |||
12 | fileUrl: string | ||
13 | fileDownloadUrl: string | ||
14 | |||
15 | fps: number | ||
16 | |||
17 | metadata?: VideoFileMetadata | ||
18 | metadataUrl?: string | ||
19 | |||
20 | magnetUri: string | null | ||
21 | } | ||
diff --git a/shared/models/videos/file/video-resolution.enum.ts b/shared/models/videos/file/video-resolution.enum.ts new file mode 100644 index 000000000..5b48ad353 --- /dev/null +++ b/shared/models/videos/file/video-resolution.enum.ts | |||
@@ -0,0 +1,11 @@ | |||
1 | export const enum 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 | } | ||