]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/types/models/video/video-redundancy.ts
Merge branch 'release/4.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / types / models / video / video-redundancy.ts
CommitLineData
b5fecbf4 1import { VideoFileModel } from '@server/models/video/video-file'
6b5f72be
C
2import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
3import { PickWith, PickWithOpt } from '@shared/typescript-utils'
4import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
5import { MVideoUrl } from './video'
d7a25329
C
6import { MVideoFile, MVideoFileVideo } from './video-file'
7import { MStreamingPlaylistVideo } from './video-streaming-playlist'
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
a1587156
C
19export type MVideoRedundancyFile =
20 MVideoRedundancy &
0283eaac 21 Use<'VideoFile', MVideoFile>
453e83ea 22
a1587156
C
23export type MVideoRedundancyFileVideo =
24 MVideoRedundancy &
0283eaac 25 Use<'VideoFile', MVideoFileVideo>
453e83ea 26
a1587156
C
27export type MVideoRedundancyStreamingPlaylistVideo =
28 MVideoRedundancy &
0283eaac 29 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
453e83ea 30
a1587156
C
31export type MVideoRedundancyVideo =
32 MVideoRedundancy &
0283eaac
C
33 Use<'VideoFile', MVideoFileVideo> &
34 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
b5fecbf4
C
35
36// ############################################################################
37
38// Format for API or AP object
39
a1587156
C
40export type MVideoRedundancyAP =
41 MVideoRedundancy &
b5fecbf4
C
42 PickWithOpt<VideoRedundancyModel, 'VideoFile', MVideoFile & PickWith<VideoFileModel, 'Video', MVideoUrl>> &
43 PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>