2019-08-15 04:53:26 -05:00
|
|
|
import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
|
2019-08-21 07:31:57 -05:00
|
|
|
import { PickWith, PickWithOpt } from '@server/typings/utils'
|
|
|
|
import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo, MVideoUrl } from '@server/typings/models'
|
|
|
|
import { VideoStreamingPlaylist } from '../../../../shared/models/videos/video-streaming-playlist.model'
|
|
|
|
import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
|
|
|
|
import { VideoFile } from '../../../../shared/models/videos'
|
|
|
|
import { VideoFileModel } from '@server/models/video/video-file'
|
2019-08-15 04:53:26 -05:00
|
|
|
|
2019-08-20 06:52:49 -05:00
|
|
|
type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 04:53:26 -05:00
|
|
|
export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'>
|
|
|
|
|
|
|
|
export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'>
|
|
|
|
|
2019-08-20 06:52:49 -05:00
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 04:53:26 -05:00
|
|
|
export type MVideoRedundancyFile = MVideoRedundancy &
|
2019-08-20 06:52:49 -05:00
|
|
|
Use<'VideoFile', MVideoFile>
|
2019-08-15 04:53:26 -05:00
|
|
|
|
|
|
|
export type MVideoRedundancyFileVideo = MVideoRedundancy &
|
2019-08-20 06:52:49 -05:00
|
|
|
Use<'VideoFile', MVideoFileVideo>
|
2019-08-15 04:53:26 -05:00
|
|
|
|
|
|
|
export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy &
|
2019-08-20 06:52:49 -05:00
|
|
|
Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
|
2019-08-15 04:53:26 -05:00
|
|
|
|
2019-08-20 06:52:49 -05:00
|
|
|
export type MVideoRedundancyVideo = MVideoRedundancy &
|
|
|
|
Use<'VideoFile', MVideoFileVideo> &
|
|
|
|
Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
|
2019-08-21 07:31:57 -05:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// Format for API or AP object
|
|
|
|
|
|
|
|
export type MVideoRedundancyAP = MVideoRedundancy &
|
|
|
|
PickWithOpt<VideoRedundancyModel, 'VideoFile', MVideoFile & PickWith<VideoFileModel, 'Video', MVideoUrl>> &
|
|
|
|
PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>
|