diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-15 15:06:03 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-25 10:59:43 +0100 |
commit | d7a25329f9e607894d29ab342b9cb66638b56dc0 (patch) | |
tree | 6cd6bc4f2689f78944238b313c93427423a932ac /server/typings/models/video/video-file.ts | |
parent | 14981d7331da3f63fe6cfaf020ccb7c910006eaf (diff) | |
download | PeerTube-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.ts | 17 |
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' | |||
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '../../utils' |
3 | import { MVideo, MVideoUUID } from './video' | 3 | import { MVideo, MVideoUUID } from './video' |
4 | import { MVideoRedundancyFileUrl } from './video-redundancy' | 4 | import { MVideoRedundancyFileUrl } from './video-redundancy' |
5 | import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist' | ||
5 | 6 | ||
6 | type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M> | 7 | type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M> |
7 | 8 | ||
8 | // ############################################################################ | 9 | // ############################################################################ |
9 | 10 | ||
10 | export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos'> | 11 | export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos' | 'VideoStreamingPlaylist'> |
11 | 12 | ||
12 | export type MVideoFileVideo = MVideoFile & | 13 | export type MVideoFileVideo = MVideoFile & |
13 | Use<'Video', MVideo> | 14 | Use<'Video', MVideo> |
14 | 15 | ||
16 | export type MVideoFileStreamingPlaylist = MVideoFile & | ||
17 | Use<'VideoStreamingPlaylist', MStreamingPlaylist> | ||
18 | |||
19 | export type MVideoFileStreamingPlaylistVideo = MVideoFile & | ||
20 | Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> | ||
21 | |||
15 | export type MVideoFileVideoUUID = MVideoFile & | 22 | export type MVideoFileVideoUUID = MVideoFile & |
16 | Use<'Video', MVideoUUID> | 23 | Use<'Video', MVideoUUID> |
17 | 24 | ||
18 | export type MVideoFileRedundanciesOpt = MVideoFile & | 25 | export type MVideoFileRedundanciesOpt = MVideoFile & |
19 | PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> | 26 | PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> |
27 | |||
28 | export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingPlaylist { | ||
29 | return !!file.videoStreamingPlaylistId | ||
30 | } | ||
31 | |||
32 | export function isWebtorrentFile (file: any): file is MVideoFileVideo { | ||
33 | return !!file.videoId | ||
34 | } | ||