aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-redundancy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/typings/models/video/video-redundancy.ts')
-rw-r--r--server/typings/models/video/video-redundancy.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/server/typings/models/video/video-redundancy.ts b/server/typings/models/video/video-redundancy.ts
new file mode 100644
index 000000000..f3846afd7
--- /dev/null
+++ b/server/typings/models/video/video-redundancy.ts
@@ -0,0 +1,38 @@
1import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
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'
8
9type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M>
10
11// ############################################################################
12
13export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'>
14
15export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'>
16
17// ############################################################################
18
19export type MVideoRedundancyFile = MVideoRedundancy &
20 Use<'VideoFile', MVideoFile>
21
22export type MVideoRedundancyFileVideo = MVideoRedundancy &
23 Use<'VideoFile', MVideoFileVideo>
24
25export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy &
26 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
27
28export type MVideoRedundancyVideo = MVideoRedundancy &
29 Use<'VideoFile', MVideoFileVideo> &
30 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
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>>