aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 19:05:31 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 19:23:10 +0200
commit1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch)
tree27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/typings/models/video/video.ts
parent0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff)
downloadPeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.gz
PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.zst
PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.zip
Type toFormattedJSON
Diffstat (limited to 'server/typings/models/video/video.ts')
-rw-r--r--server/typings/models/video/video.ts27
1 files changed, 25 insertions, 2 deletions
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 @@
1import { VideoModel } from '../../../models/video/video' 1import { VideoModel } from '../../../models/video/video'
2import { PickWith, PickWithOpt } from '../../utils' 2import { PickWith, PickWithOpt } from '../../utils'
3import { MChannelAccountDefault, MChannelAccountLight, MChannelActor, MChannelUserId } from './video-channels' 3import {
4 MChannelAccountDefault,
5 MChannelAccountLight,
6 MChannelAccountSummaryFormattable,
7 MChannelActor,
8 MChannelFormattable,
9 MChannelUserId
10} from './video-channels'
4import { MTag } from './tag' 11import { MTag } from './tag'
5import { MVideoCaptionLanguage } from './video-caption' 12import { MVideoCaptionLanguage } from './video-caption'
6import { MStreamingPlaylist, MStreamingPlaylistRedundancies } from './video-streaming-playlist' 13import { MStreamingPlaylist, MStreamingPlaylistRedundancies } from './video-streaming-playlist'
7import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file' 14import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file'
8import { MThumbnail } from './thumbnail' 15import { MThumbnail } from './thumbnail'
9import { MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' 16import { MVideoBlacklist, MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist'
10import { MScheduleVideoUpdate } from './schedule-video-update' 17import { MScheduleVideoUpdate } from './schedule-video-update'
11import { MUserVideoHistoryTime } from '../user/user-video-history' 18import { MUserVideoHistoryTime } from '../user/user-video-history'
12 19
@@ -144,3 +151,19 @@ export type MVideoForUser = MVideo &
144 Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & 151 Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> &
145 Use<'VideoBlacklist', MVideoBlacklistLight> & 152 Use<'VideoBlacklist', MVideoBlacklistLight> &
146 Use<'Thumbnails', MThumbnail[]> 153 Use<'Thumbnails', MThumbnail[]>
154
155// ############################################################################
156
157// Format for API or AP object
158
159export type MVideoFormattable = MVideo &
160 PickWithOpt<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]> &
161 Use<'VideoChannel', MChannelAccountSummaryFormattable> &
162 PickWithOpt<VideoModel, 'ScheduleVideoUpdate', Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'>> &
163 PickWithOpt<VideoModel, 'VideoBlacklist', Pick<MVideoBlacklist, 'reason'>>
164
165export type MVideoFormattableDetails = MVideoFormattable &
166 Use<'VideoChannel', MChannelFormattable> &
167 Use<'Tags', MTag[]> &
168 Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> &
169 Use<'VideoFiles', MVideoFileRedundanciesOpt[]>