aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/videos
diff options
context:
space:
mode:
Diffstat (limited to 'shared/models/videos')
-rw-r--r--shared/models/videos/video-file-metadata.ts18
-rw-r--r--shared/models/videos/video-file.model.ts3
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 @@
1import { FfprobeData } from "fluent-ffmpeg"
2import { DeepOmit } from "@server/models/utils"
3
4export type VideoFileMetadataModel = DeepOmit<FfprobeData, 'filename'>
5
6export 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 @@
1import { VideoConstant, VideoResolution } from '@shared/models' 1import { VideoConstant, VideoResolution } from '@shared/models'
2import { FfprobeData } from 'fluent-ffmpeg'
2 3
3export interface VideoFile { 4export 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}