aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types/models/video/video-redundancy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/types/models/video/video-redundancy.ts')
-rw-r--r--server/types/models/video/video-redundancy.ts43
1 files changed, 43 insertions, 0 deletions
diff --git a/server/types/models/video/video-redundancy.ts b/server/types/models/video/video-redundancy.ts
new file mode 100644
index 000000000..7c7d52035
--- /dev/null
+++ b/server/types/models/video/video-redundancy.ts
@@ -0,0 +1,43 @@
1import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
2import { PickWith, PickWithOpt } from '@server/types/utils'
3import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
4import { VideoFileModel } from '@server/models/video/video-file'
5import { MVideoFile, MVideoFileVideo } from './video-file'
6import { MStreamingPlaylistVideo } from './video-streaming-playlist'
7import { MVideoUrl } from './video'
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 =
20 MVideoRedundancy &
21 Use<'VideoFile', MVideoFile>
22
23export type MVideoRedundancyFileVideo =
24 MVideoRedundancy &
25 Use<'VideoFile', MVideoFileVideo>
26
27export type MVideoRedundancyStreamingPlaylistVideo =
28 MVideoRedundancy &
29 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
30
31export type MVideoRedundancyVideo =
32 MVideoRedundancy &
33 Use<'VideoFile', MVideoFileVideo> &
34 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
35
36// ############################################################################
37
38// Format for API or AP object
39
40export type MVideoRedundancyAP =
41 MVideoRedundancy &
42 PickWithOpt<VideoRedundancyModel, 'VideoFile', MVideoFile & PickWith<VideoFileModel, 'Video', MVideoUrl>> &
43 PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>