diff options
Diffstat (limited to 'server/typings/models/video/video-streaming-playlist.ts')
-rw-r--r-- | server/typings/models/video/video-streaming-playlist.ts | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/server/typings/models/video/video-streaming-playlist.ts b/server/typings/models/video/video-streaming-playlist.ts index 79696bcff..436c0c072 100644 --- a/server/typings/models/video/video-streaming-playlist.ts +++ b/server/typings/models/video/video-streaming-playlist.ts | |||
@@ -1,19 +1,33 @@ | |||
1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' | 1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '../../utils' |
3 | import { MVideoRedundancyFileUrl } from './video-redundancy' | 3 | import { MVideoRedundancyFileUrl } from './video-redundancy' |
4 | import { MVideo, MVideoUrl } from '@server/typings/models' | 4 | import { MVideo } from './video' |
5 | import { MVideoFile } from './video-file' | ||
5 | 6 | ||
6 | type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M> | 7 | type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M> |
7 | 8 | ||
8 | // ############################################################################ | 9 | // ############################################################################ |
9 | 10 | ||
10 | export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos'> | 11 | export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'> |
12 | |||
13 | export type MStreamingPlaylistFiles = MStreamingPlaylist & | ||
14 | Use<'VideoFiles', MVideoFile[]> | ||
11 | 15 | ||
12 | export type MStreamingPlaylistVideo = MStreamingPlaylist & | 16 | export type MStreamingPlaylistVideo = MStreamingPlaylist & |
13 | Use<'Video', MVideo> | 17 | Use<'Video', MVideo> |
14 | 18 | ||
19 | export type MStreamingPlaylistFilesVideo = MStreamingPlaylist & | ||
20 | Use<'VideoFiles', MVideoFile[]> & | ||
21 | Use<'Video', MVideo> | ||
22 | |||
15 | export type MStreamingPlaylistRedundancies = MStreamingPlaylist & | 23 | export type MStreamingPlaylistRedundancies = MStreamingPlaylist & |
24 | Use<'VideoFiles', MVideoFile[]> & | ||
16 | Use<'RedundancyVideos', MVideoRedundancyFileUrl[]> | 25 | Use<'RedundancyVideos', MVideoRedundancyFileUrl[]> |
17 | 26 | ||
18 | export type MStreamingPlaylistRedundanciesOpt = MStreamingPlaylist & | 27 | export type MStreamingPlaylistRedundanciesOpt = MStreamingPlaylist & |
28 | Use<'VideoFiles', MVideoFile[]> & | ||
19 | PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> | 29 | PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> |
30 | |||
31 | export function isStreamingPlaylist (value: MVideo | MStreamingPlaylistVideo): value is MStreamingPlaylistVideo { | ||
32 | return !!(value as MStreamingPlaylist).playlistUrl | ||
33 | } | ||