diff options
Diffstat (limited to 'shared/models/videos')
-rw-r--r-- | shared/models/videos/video-file-metadata.ts | 18 | ||||
-rw-r--r-- | shared/models/videos/video-file.model.ts | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/shared/models/videos/video-file-metadata.ts b/shared/models/videos/video-file-metadata.ts new file mode 100644 index 000000000..15683cacf --- /dev/null +++ b/shared/models/videos/video-file-metadata.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | import { FfprobeData } from "fluent-ffmpeg" | ||
2 | import { DeepOmit } from "@server/models/utils" | ||
3 | |||
4 | export type VideoFileMetadataModel = DeepOmit<FfprobeData, 'filename'> | ||
5 | |||
6 | export class VideoFileMetadata implements VideoFileMetadataModel { | ||
7 | streams: { [x: string]: any, [x: number]: any }[] | ||
8 | format: { [x: string]: any, [x: number]: any } | ||
9 | chapters: any[] | ||
10 | |||
11 | constructor (hash: Partial<VideoFileMetadataModel>) { | ||
12 | this.chapters = hash.chapters | ||
13 | this.format = hash.format | ||
14 | this.streams = hash.streams | ||
15 | |||
16 | delete this.format.filename | ||
17 | } | ||
18 | } | ||
diff --git a/shared/models/videos/video-file.model.ts b/shared/models/videos/video-file.model.ts index 04da0627e..6cc2d5aee 100644 --- a/shared/models/videos/video-file.model.ts +++ b/shared/models/videos/video-file.model.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { VideoConstant, VideoResolution } from '@shared/models' | 1 | import { VideoConstant, VideoResolution } from '@shared/models' |
2 | import { FfprobeData } from 'fluent-ffmpeg' | ||
2 | 3 | ||
3 | export interface VideoFile { | 4 | export interface VideoFile { |
4 | magnetUri: string | 5 | magnetUri: string |
@@ -9,4 +10,6 @@ export interface VideoFile { | |||
9 | fileUrl: string | 10 | fileUrl: string |
10 | fileDownloadUrl: string | 11 | fileDownloadUrl: string |
11 | fps: number | 12 | fps: number |
13 | metadata?: FfprobeData | ||
14 | metadataUrl?: string | ||
12 | } | 15 | } |