aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-file.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-11-15 15:06:03 +0100
committerChocobozzz <me@florianbigard.com>2019-11-25 10:59:43 +0100
commitd7a25329f9e607894d29ab342b9cb66638b56dc0 (patch)
tree6cd6bc4f2689f78944238b313c93427423a932ac /server/typings/models/video/video-file.ts
parent14981d7331da3f63fe6cfaf020ccb7c910006eaf (diff)
downloadPeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.gz
PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.zst
PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.zip
Add ability to disable webtorrent
In favour of HLS
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}