X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftypings%2Fmodels%2Fvideo%2Fvideo-file.ts;h=139b22b2c931b6ea37ad72333774385934c5ed08;hb=b764380ac23f4e9d4677d08acdc3474c2931a16d;hp=484351a8d03fdf4d4aaeaeb57104acc38038bf95;hpb=8c559fad1e1c4c2ab7f1388c73200aa4c6256d74;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/typings/models/video/video-file.ts b/server/typings/models/video/video-file.ts index 484351a8d..139b22b2c 100644 --- a/server/typings/models/video/video-file.ts +++ b/server/typings/models/video/video-file.ts @@ -1,19 +1,37 @@ import { VideoFileModel } from '../../../models/video/video-file' import { PickWith, PickWithOpt } from '../../utils' import { MVideo, MVideoUUID } from './video' -import { MVideoRedundancyFileUrl } from './video-redundancy' +import { MVideoRedundancy, MVideoRedundancyFileUrl } from './video-redundancy' +import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist' type Use = PickWith // ############################################################################ -export type MVideoFile = Omit +export type MVideoFile = Omit export type MVideoFileVideo = MVideoFile & Use<'Video', MVideo> +export type MVideoFileStreamingPlaylist = MVideoFile & + Use<'VideoStreamingPlaylist', MStreamingPlaylist> + +export type MVideoFileStreamingPlaylistVideo = MVideoFile & + Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> + export type MVideoFileVideoUUID = MVideoFile & Use<'Video', MVideoUUID> +export type MVideoFileRedundanciesAll = MVideoFile & + PickWithOpt + export type MVideoFileRedundanciesOpt = MVideoFile & PickWithOpt + +export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingPlaylist { + return !!file.videoStreamingPlaylistId +} + +export function isWebtorrentFile (file: any): file is MVideoFileVideo { + return !!file.videoId +}