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