aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video.ts
blob: 0ffd0c30222ffd1dde5bc28e951bfd2f15966d80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import { VideoModel } from '../../../models/video/video'
import { PickWith, PickWithOpt } from '../../utils'
import { MChannelAccountLight, MChannelActor, MChannelActorAccountDefault, 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 { MScheduleVideoUpdate } from './schedule-video-update'
import { MUserVideoHistoryTime } from '../user/user-video-history'

export type MVideo = Omit<VideoModel, 'VideoChannel' | 'Tags' | 'Thumbnails' | 'VideoPlaylistElements' | 'VideoAbuses' |
  'VideoFiles' | 'VideoStreamingPlaylists' | 'VideoShares' | 'AccountVideoRates' | 'VideoComments' | 'VideoViews' | 'UserVideoHistories' |
  'ScheduleVideoUpdate' | 'VideoBlacklist' | 'VideoImport' | 'VideoCaptions'>

export type MVideoId = Pick<MVideo, 'id'>
export type MVideoUrl = Pick<MVideo, 'url'>
export type MVideoUUID = Pick<MVideo, 'uuid'>

export type MVideoIdUrl = MVideoId & MVideoUrl
export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'>

export type MVideoWithFile = MVideo &
  PickWith<VideoModel, 'VideoFiles', MVideoFile[]>

export type MVideoThumbnail = MVideo &
  PickWith<VideoModel, 'Thumbnails', MThumbnail[]>
export type MVideoIdThumbnail = MVideoThumbnail & MVideoId

export type MVideoTag = MVideo &
  PickWith<VideoModel, 'Tags', MTag[]>

export type MVideoWithSchedule = MVideo &
  PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate>

export type MVideoWithFileThumbnail = MVideoWithFile & MVideoThumbnail

export type MVideoUser = MVideo &
  PickWith<VideoModel, 'VideoChannel', MChannelUserId>

export type MVideoWithCaptions = MVideo &
  PickWith<VideoModel, 'VideoCaptions', MVideoCaptionLanguage[]>

export type MVideoWithBlacklistLight = MVideo &
  PickWith<VideoModel, 'VideoBlacklist', MVideoBlacklistLight>

export type MVideoAccountLight = MVideo &
  PickWith<VideoModel, 'VideoChannel', MChannelAccountLight>

export type MVideoWithRights = MVideoWithBlacklistLight & MVideoThumbnail & MVideoUser

export type MVideoWithStreamingPlaylist = MVideo &
  PickWith<VideoModel, 'VideoStreamingPlaylists', MStreamingPlaylist[]>

export type MVideoWithAllFiles = MVideoWithFileThumbnail & MVideoWithStreamingPlaylist

export type MVideoAccountAllFiles = MVideoWithAllFiles & MVideoAccountLight & MVideoWithBlacklistLight
export type MVideoAccountAllFilesCaptions = MVideoAccountAllFiles & MVideoWithCaptions

export type MVideoUserHistory = MVideo &
  PickWith<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]>

export type MVideoWithBlacklistThumbnailScheduled = MVideoWithSchedule & MVideoWithBlacklistLight & MVideoWithFileThumbnail

export type MVideoAccountDefault = MVideo &
  PickWith<VideoModel, 'VideoChannel', MChannelActorAccountDefault>

export type MVideoThumbnailAccountDefault = MVideoThumbnail &
  PickWith<VideoModel, 'VideoChannel', MChannelActorAccountDefault>

export type MVideoWithChannelActor = MVideo &
  PickWith<VideoModel, 'VideoChannel', MChannelActor>

export type MVideoFullLight = MVideoThumbnail &
  MVideoWithBlacklistLight &
  MVideoTag &
  MVideoAccountLight &
  MVideoUserHistory &
  MVideoWithFile &
  MVideoWithSchedule &
  MVideoWithStreamingPlaylist &
  MVideoUserHistory

export type MVideoAP = MVideo &
  MVideoTag &
  MVideoAccountLight &
  MVideoWithStreamingPlaylist &
  MVideoWithCaptions &
  PickWith<VideoModel, 'VideoBlacklist', MVideoBlacklistUnfederated> &
  PickWith<VideoModel, 'VideoFiles', MVideoFileRedundanciesOpt[]>

export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'>

export type MVideoDetails = MVideo &
  MVideoWithBlacklistLight &
  MVideoTag &
  MVideoAccountLight &
  MVideoWithSchedule &
  MVideoThumbnail &
  MVideoUserHistory &
  PickWith<VideoModel, 'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> &
  PickWith<VideoModel, 'VideoFiles', MVideoFileRedundanciesOpt[]>