aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/typings/models/video/video-file.ts')
-rw-r--r--server/typings/models/video/video-file.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/server/typings/models/video/video-file.ts b/server/typings/models/video/video-file.ts
index 484351a8d..352fe3d32 100644
--- a/server/typings/models/video/video-file.ts
+++ b/server/typings/models/video/video-file.ts
@@ -2,18 +2,33 @@ import { VideoFileModel } from '../../../models/video/video-file'
2import { PickWith, PickWithOpt } from '../../utils' 2import { PickWith, PickWithOpt } from '../../utils'
3import { MVideo, MVideoUUID } from './video' 3import { MVideo, MVideoUUID } from './video'
4import { MVideoRedundancyFileUrl } from './video-redundancy' 4import { MVideoRedundancyFileUrl } from './video-redundancy'
5import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist'
5 6
6type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M> 7type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M>
7 8
8// ############################################################################ 9// ############################################################################
9 10
10export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos'> 11export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos' | 'VideoStreamingPlaylist'>
11 12
12export type MVideoFileVideo = MVideoFile & 13export type MVideoFileVideo = MVideoFile &
13 Use<'Video', MVideo> 14 Use<'Video', MVideo>
14 15
16export type MVideoFileStreamingPlaylist = MVideoFile &
17 Use<'VideoStreamingPlaylist', MStreamingPlaylist>
18
19export type MVideoFileStreamingPlaylistVideo = MVideoFile &
20 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
21
15export type MVideoFileVideoUUID = MVideoFile & 22export type MVideoFileVideoUUID = MVideoFile &
16 Use<'Video', MVideoUUID> 23 Use<'Video', MVideoUUID>
17 24
18export type MVideoFileRedundanciesOpt = MVideoFile & 25export type MVideoFileRedundanciesOpt = MVideoFile &
19 PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> 26 PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>
27
28export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingPlaylist {
29 return !!file.videoStreamingPlaylistId
30}
31
32export function isWebtorrentFile (file: any): file is MVideoFileVideo {
33 return !!file.videoId
34}