aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/videos/file
diff options
context:
space:
mode:
Diffstat (limited to 'shared/models/videos/file')
-rw-r--r--shared/models/videos/file/index.ts3
-rw-r--r--shared/models/videos/file/video-file-metadata.model.ts13
-rw-r--r--shared/models/videos/file/video-file.model.ts21
-rw-r--r--shared/models/videos/file/video-resolution.enum.ts11
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 @@
1export * from './video-file-metadata.model'
2export * from './video-file.model'
3export * 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 @@
1export 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 @@
1import { VideoConstant } from '../video-constant.model'
2import { VideoFileMetadata } from './video-file-metadata.model'
3import { VideoResolution } from './video-resolution.enum'
4
5export 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 @@
1export 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}