aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/models/videos/video-file-metadata.ts
blob: 15683cacfb233321a3a7c06c802a5ad3e022d690 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                      
import { FfprobeData } from "fluent-ffmpeg"
import { DeepOmit } from "@server/models/utils"

export type VideoFileMetadataModel = DeepOmit<FfprobeData, 'filename'>

export class VideoFileMetadata implements VideoFileMetadataModel {
  streams: { [x: string]: any, [x: number]: any }[]
  format: { [x: string]: any, [x: number]: any }
  chapters: any[]

  constructor (hash: Partial<VideoFileMetadataModel>) {
    this.chapters = hash.chapters
    this.format = hash.format
    this.streams = hash.streams

    delete this.format.filename
  }
}