diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:05:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:23:10 +0200 |
commit | 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch) | |
tree | 27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/typings/models/video/video.ts | |
parent | 0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff) | |
download | PeerTube-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.ts | 27 |
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 @@ | |||
1 | import { VideoModel } from '../../../models/video/video' | 1 | import { VideoModel } from '../../../models/video/video' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '../../utils' |
3 | import { MChannelAccountDefault, MChannelAccountLight, MChannelActor, MChannelUserId } from './video-channels' | 3 | import { |
4 | MChannelAccountDefault, | ||
5 | MChannelAccountLight, | ||
6 | MChannelAccountSummaryFormattable, | ||
7 | MChannelActor, | ||
8 | MChannelFormattable, | ||
9 | MChannelUserId | ||
10 | } from './video-channels' | ||
4 | import { MTag } from './tag' | 11 | import { MTag } from './tag' |
5 | import { MVideoCaptionLanguage } from './video-caption' | 12 | import { MVideoCaptionLanguage } from './video-caption' |
6 | import { MStreamingPlaylist, MStreamingPlaylistRedundancies } from './video-streaming-playlist' | 13 | import { MStreamingPlaylist, MStreamingPlaylistRedundancies } from './video-streaming-playlist' |
7 | import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file' | 14 | import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file' |
8 | import { MThumbnail } from './thumbnail' | 15 | import { MThumbnail } from './thumbnail' |
9 | import { MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' | 16 | import { MVideoBlacklist, MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' |
10 | import { MScheduleVideoUpdate } from './schedule-video-update' | 17 | import { MScheduleVideoUpdate } from './schedule-video-update' |
11 | import { MUserVideoHistoryTime } from '../user/user-video-history' | 18 | import { 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 | |||
159 | export 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 | |||
165 | export type MVideoFormattableDetails = MVideoFormattable & | ||
166 | Use<'VideoChannel', MChannelFormattable> & | ||
167 | Use<'Tags', MTag[]> & | ||
168 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> & | ||
169 | Use<'VideoFiles', MVideoFileRedundanciesOpt[]> | ||