From 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Aug 2019 19:05:31 +0200 Subject: Type toFormattedJSON --- server/typings/models/video/video.ts | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'server/typings/models/video/video.ts') diff --git a/server/typings/models/video/video.ts b/server/typings/models/video/video.ts index 914eb7f57..bc6d56607 100644 --- a/server/typings/models/video/video.ts +++ b/server/typings/models/video/video.ts @@ -1,12 +1,19 @@ import { VideoModel } from '../../../models/video/video' import { PickWith, PickWithOpt } from '../../utils' -import { MChannelAccountDefault, MChannelAccountLight, MChannelActor, MChannelUserId } from './video-channels' +import { + MChannelAccountDefault, + MChannelAccountLight, + MChannelAccountSummaryFormattable, + MChannelActor, + MChannelFormattable, + MChannelUserId +} from './video-channels' import { MTag } from './tag' import { MVideoCaptionLanguage } from './video-caption' import { MStreamingPlaylist, MStreamingPlaylistRedundancies } from './video-streaming-playlist' import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file' import { MThumbnail } from './thumbnail' -import { MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' +import { MVideoBlacklist, MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' import { MScheduleVideoUpdate } from './schedule-video-update' import { MUserVideoHistoryTime } from '../user/user-video-history' @@ -144,3 +151,19 @@ export type MVideoForUser = MVideo & Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & Use<'VideoBlacklist', MVideoBlacklistLight> & Use<'Thumbnails', MThumbnail[]> + +// ############################################################################ + +// Format for API or AP object + +export type MVideoFormattable = MVideo & + PickWithOpt & + Use<'VideoChannel', MChannelAccountSummaryFormattable> & + PickWithOpt> & + PickWithOpt> + +export type MVideoFormattableDetails = MVideoFormattable & + Use<'VideoChannel', MChannelFormattable> & + Use<'Tags', MTag[]> & + Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> & + Use<'VideoFiles', MVideoFileRedundanciesOpt[]> -- cgit v1.2.3