]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/models/video/video-streaming-playlist.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-streaming-playlist.ts
CommitLineData
453e83ea 1import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist'
b5fecbf4 2import { PickWith, PickWithOpt } from '../../utils'
b764380a 3import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy'
d7a25329
C
4import { MVideo } from './video'
5import { MVideoFile } from './video-file'
453e83ea 6
0283eaac
C
7type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M>
8
9// ############################################################################
10
d7a25329
C
11export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'>
12
a1587156
C
13export type MStreamingPlaylistFiles =
14 MStreamingPlaylist &
d7a25329 15 Use<'VideoFiles', MVideoFile[]>
453e83ea 16
a1587156
C
17export type MStreamingPlaylistVideo =
18 MStreamingPlaylist &
0283eaac 19 Use<'Video', MVideo>
453e83ea 20
a1587156
C
21export type MStreamingPlaylistFilesVideo =
22 MStreamingPlaylist &
d7a25329
C
23 Use<'VideoFiles', MVideoFile[]> &
24 Use<'Video', MVideo>
25
a1587156
C
26export type MStreamingPlaylistRedundanciesAll =
27 MStreamingPlaylist &
b764380a
C
28 Use<'VideoFiles', MVideoFile[]> &
29 Use<'RedundancyVideos', MVideoRedundancy[]>
30
a1587156
C
31export type MStreamingPlaylistRedundancies =
32 MStreamingPlaylist &
d7a25329 33 Use<'VideoFiles', MVideoFile[]> &
0283eaac 34 Use<'RedundancyVideos', MVideoRedundancyFileUrl[]>
b5fecbf4 35
a1587156
C
36export type MStreamingPlaylistRedundanciesOpt =
37 MStreamingPlaylist &
d7a25329 38 Use<'VideoFiles', MVideoFile[]> &
b5fecbf4 39 PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>
d7a25329
C
40
41export function isStreamingPlaylist (value: MVideo | MStreamingPlaylistVideo): value is MStreamingPlaylistVideo {
42 return !!(value as MStreamingPlaylist).playlistUrl
43}