]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/models/video/video-redundancy.ts
Merge branch 'release/1.4.0' into develop
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-redundancy.ts
CommitLineData
453e83ea 1import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
b5fecbf4
C
2import { PickWith, PickWithOpt } from '@server/typings/utils'
3import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo, MVideoUrl } from '@server/typings/models'
4import { VideoStreamingPlaylist } from '../../../../shared/models/videos/video-streaming-playlist.model'
5import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
6import { VideoFile } from '../../../../shared/models/videos'
7import { VideoFileModel } from '@server/models/video/video-file'
453e83ea 8
0283eaac
C
9type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M>
10
11// ############################################################################
12
453e83ea
C
13export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'>
14
15export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'>
16
0283eaac
C
17// ############################################################################
18
453e83ea 19export type MVideoRedundancyFile = MVideoRedundancy &
0283eaac 20 Use<'VideoFile', MVideoFile>
453e83ea
C
21
22export type MVideoRedundancyFileVideo = MVideoRedundancy &
0283eaac 23 Use<'VideoFile', MVideoFileVideo>
453e83ea
C
24
25export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy &
0283eaac 26 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
453e83ea 27
0283eaac
C
28export type MVideoRedundancyVideo = MVideoRedundancy &
29 Use<'VideoFile', MVideoFileVideo> &
30 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
b5fecbf4
C
31
32// ############################################################################
33
34// Format for API or AP object
35
36export type MVideoRedundancyAP = MVideoRedundancy &
37 PickWithOpt<VideoRedundancyModel, 'VideoFile', MVideoFile & PickWith<VideoFileModel, 'Video', MVideoUrl>> &
38 PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>