From b764380ac23f4e9d4677d08acdc3474c2931a16d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jan 2020 10:11:28 +0100 Subject: Add ability to list redundancies --- server/typings/models/video/video-file.ts | 5 ++++- server/typings/models/video/video-streaming-playlist.ts | 6 +++++- server/typings/models/video/video.ts | 13 +++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'server/typings/models') diff --git a/server/typings/models/video/video-file.ts b/server/typings/models/video/video-file.ts index 352fe3d32..139b22b2c 100644 --- a/server/typings/models/video/video-file.ts +++ b/server/typings/models/video/video-file.ts @@ -1,7 +1,7 @@ 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 @@ -22,6 +22,9 @@ export type MVideoFileStreamingPlaylistVideo = MVideoFile & export type MVideoFileVideoUUID = MVideoFile & Use<'Video', MVideoUUID> +export type MVideoFileRedundanciesAll = MVideoFile & + PickWithOpt + export type MVideoFileRedundanciesOpt = MVideoFile & PickWithOpt diff --git a/server/typings/models/video/video-streaming-playlist.ts b/server/typings/models/video/video-streaming-playlist.ts index 436c0c072..6fd489945 100644 --- a/server/typings/models/video/video-streaming-playlist.ts +++ b/server/typings/models/video/video-streaming-playlist.ts @@ -1,6 +1,6 @@ import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' import { PickWith, PickWithOpt } from '../../utils' -import { MVideoRedundancyFileUrl } from './video-redundancy' +import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy' import { MVideo } from './video' import { MVideoFile } from './video-file' @@ -20,6 +20,10 @@ export type MStreamingPlaylistFilesVideo = MStreamingPlaylist & Use<'VideoFiles', MVideoFile[]> & Use<'Video', MVideo> +export type MStreamingPlaylistRedundanciesAll = MStreamingPlaylist & + Use<'VideoFiles', MVideoFile[]> & + Use<'RedundancyVideos', MVideoRedundancy[]> + export type MStreamingPlaylistRedundancies = MStreamingPlaylist & Use<'VideoFiles', MVideoFile[]> & Use<'RedundancyVideos', MVideoRedundancyFileUrl[]> diff --git a/server/typings/models/video/video.ts b/server/typings/models/video/video.ts index 7f69a91de..bcc5e5028 100644 --- a/server/typings/models/video/video.ts +++ b/server/typings/models/video/video.ts @@ -10,8 +10,13 @@ import { } from './video-channels' import { MTag } from './tag' import { MVideoCaptionLanguage } from './video-caption' -import { MStreamingPlaylistFiles, MStreamingPlaylistRedundancies, MStreamingPlaylistRedundanciesOpt } from './video-streaming-playlist' -import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file' +import { + MStreamingPlaylistFiles, + MStreamingPlaylistRedundancies, + MStreamingPlaylistRedundanciesAll, + MStreamingPlaylistRedundanciesOpt +} from './video-streaming-playlist' +import { MVideoFile, MVideoFileRedundanciesAll, MVideoFileRedundanciesOpt } from './video-file' import { MThumbnail } from './thumbnail' import { MVideoBlacklist, MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' import { MScheduleVideoUpdate } from './schedule-video-update' @@ -158,6 +163,10 @@ export type MVideoForUser = MVideo & Use<'VideoBlacklist', MVideoBlacklistLight> & Use<'Thumbnails', MThumbnail[]> +export type MVideoForRedundancyAPI = MVideo & + Use<'VideoFiles', MVideoFileRedundanciesAll[]> & + Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]> + // ############################################################################ // Format for API or AP object -- cgit v1.2.3