aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/models/videos/video-file-metadata.ts
blob: 010bf7cf59c4a25f5c160974d73d62134194fa27 (plain) (tree)
1
2
                                           














                                                                      
import { FfprobeData } from 'fluent-ffmpeg'
import { DeepOmit } from '../../core-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
  }
}