diff options
Diffstat (limited to 'server/typings/models/video/video.ts')
-rw-r--r-- | server/typings/models/video/video.ts | 78 |
1 files changed, 52 insertions, 26 deletions
diff --git a/server/typings/models/video/video.ts b/server/typings/models/video/video.ts index 82d76f40c..7eff0a913 100644 --- a/server/typings/models/video/video.ts +++ b/server/typings/models/video/video.ts | |||
@@ -26,7 +26,8 @@ type Use<K extends keyof VideoModel, M> = PickWith<VideoModel, K, M> | |||
26 | 26 | ||
27 | // ############################################################################ | 27 | // ############################################################################ |
28 | 28 | ||
29 | export type MVideo = Omit<VideoModel, 'VideoChannel' | 'Tags' | 'Thumbnails' | 'VideoPlaylistElements' | 'VideoAbuses' | | 29 | export type MVideo = |
30 | Omit<VideoModel, 'VideoChannel' | 'Tags' | 'Thumbnails' | 'VideoPlaylistElements' | 'VideoAbuses' | | ||
30 | 'VideoFiles' | 'VideoStreamingPlaylists' | 'VideoShares' | 'AccountVideoRates' | 'VideoComments' | 'VideoViews' | 'UserVideoHistories' | | 31 | 'VideoFiles' | 'VideoStreamingPlaylists' | 'VideoShares' | 'AccountVideoRates' | 'VideoComments' | 'VideoViews' | 'UserVideoHistories' | |
31 | 'ScheduleVideoUpdate' | 'VideoBlacklist' | 'VideoImport' | 'VideoCaptions'> | 32 | 'ScheduleVideoUpdate' | 'VideoBlacklist' | 'VideoImport' | 'VideoCaptions'> |
32 | 33 | ||
@@ -44,50 +45,63 @@ export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'> | |||
44 | // Video raw associations: schedules, video files, tags, thumbnails, captions, streaming playlists | 45 | // Video raw associations: schedules, video files, tags, thumbnails, captions, streaming playlists |
45 | 46 | ||
46 | // "With" to not confuse with the VideoFile model | 47 | // "With" to not confuse with the VideoFile model |
47 | export type MVideoWithFile = MVideo & | 48 | export type MVideoWithFile = |
49 | MVideo & | ||
48 | Use<'VideoFiles', MVideoFile[]> & | 50 | Use<'VideoFiles', MVideoFile[]> & |
49 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> | 51 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> |
50 | 52 | ||
51 | export type MVideoThumbnail = MVideo & | 53 | export type MVideoThumbnail = |
54 | MVideo & | ||
52 | Use<'Thumbnails', MThumbnail[]> | 55 | Use<'Thumbnails', MThumbnail[]> |
53 | 56 | ||
54 | export type MVideoIdThumbnail = MVideoId & | 57 | export type MVideoIdThumbnail = |
58 | MVideoId & | ||
55 | Use<'Thumbnails', MThumbnail[]> | 59 | Use<'Thumbnails', MThumbnail[]> |
56 | 60 | ||
57 | export type MVideoWithFileThumbnail = MVideo & | 61 | export type MVideoWithFileThumbnail = |
62 | MVideo & | ||
58 | Use<'VideoFiles', MVideoFile[]> & | 63 | Use<'VideoFiles', MVideoFile[]> & |
59 | Use<'Thumbnails', MThumbnail[]> | 64 | Use<'Thumbnails', MThumbnail[]> |
60 | 65 | ||
61 | export type MVideoThumbnailBlacklist = MVideo & | 66 | export type MVideoThumbnailBlacklist = |
67 | MVideo & | ||
62 | Use<'Thumbnails', MThumbnail[]> & | 68 | Use<'Thumbnails', MThumbnail[]> & |
63 | Use<'VideoBlacklist', MVideoBlacklistLight> | 69 | Use<'VideoBlacklist', MVideoBlacklistLight> |
64 | 70 | ||
65 | export type MVideoTag = MVideo & | 71 | export type MVideoTag = |
72 | MVideo & | ||
66 | Use<'Tags', MTag[]> | 73 | Use<'Tags', MTag[]> |
67 | 74 | ||
68 | export type MVideoWithSchedule = MVideo & | 75 | export type MVideoWithSchedule = |
76 | MVideo & | ||
69 | PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate> | 77 | PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate> |
70 | 78 | ||
71 | export type MVideoWithCaptions = MVideo & | 79 | export type MVideoWithCaptions = |
80 | MVideo & | ||
72 | Use<'VideoCaptions', MVideoCaptionLanguage[]> | 81 | Use<'VideoCaptions', MVideoCaptionLanguage[]> |
73 | 82 | ||
74 | export type MVideoWithStreamingPlaylist = MVideo & | 83 | export type MVideoWithStreamingPlaylist = |
84 | MVideo & | ||
75 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> | 85 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> |
76 | 86 | ||
77 | // ############################################################################ | 87 | // ############################################################################ |
78 | 88 | ||
79 | // Associations with not all their attributes | 89 | // Associations with not all their attributes |
80 | 90 | ||
81 | export type MVideoUserHistory = MVideo & | 91 | export type MVideoUserHistory = |
92 | MVideo & | ||
82 | Use<'UserVideoHistories', MUserVideoHistoryTime[]> | 93 | Use<'UserVideoHistories', MUserVideoHistoryTime[]> |
83 | 94 | ||
84 | export type MVideoWithBlacklistLight = MVideo & | 95 | export type MVideoWithBlacklistLight = |
96 | MVideo & | ||
85 | Use<'VideoBlacklist', MVideoBlacklistLight> | 97 | Use<'VideoBlacklist', MVideoBlacklistLight> |
86 | 98 | ||
87 | export type MVideoAccountLight = MVideo & | 99 | export type MVideoAccountLight = |
100 | MVideo & | ||
88 | Use<'VideoChannel', MChannelAccountLight> | 101 | Use<'VideoChannel', MChannelAccountLight> |
89 | 102 | ||
90 | export type MVideoWithRights = MVideo & | 103 | export type MVideoWithRights = |
104 | MVideo & | ||
91 | Use<'VideoBlacklist', MVideoBlacklistLight> & | 105 | Use<'VideoBlacklist', MVideoBlacklistLight> & |
92 | Use<'Thumbnails', MThumbnail[]> & | 106 | Use<'Thumbnails', MThumbnail[]> & |
93 | Use<'VideoChannel', MChannelUserId> | 107 | Use<'VideoChannel', MChannelUserId> |
@@ -96,12 +110,14 @@ export type MVideoWithRights = MVideo & | |||
96 | 110 | ||
97 | // All files with some additional associations | 111 | // All files with some additional associations |
98 | 112 | ||
99 | export type MVideoWithAllFiles = MVideo & | 113 | export type MVideoWithAllFiles = |
114 | MVideo & | ||
100 | Use<'VideoFiles', MVideoFile[]> & | 115 | Use<'VideoFiles', MVideoFile[]> & |
101 | Use<'Thumbnails', MThumbnail[]> & | 116 | Use<'Thumbnails', MThumbnail[]> & |
102 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> | 117 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> |
103 | 118 | ||
104 | export type MVideoAccountLightBlacklistAllFiles = MVideo & | 119 | export type MVideoAccountLightBlacklistAllFiles = |
120 | MVideo & | ||
105 | Use<'VideoFiles', MVideoFile[]> & | 121 | Use<'VideoFiles', MVideoFile[]> & |
106 | Use<'Thumbnails', MThumbnail[]> & | 122 | Use<'Thumbnails', MThumbnail[]> & |
107 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & | 123 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & |
@@ -112,17 +128,21 @@ export type MVideoAccountLightBlacklistAllFiles = MVideo & | |||
112 | 128 | ||
113 | // With account | 129 | // With account |
114 | 130 | ||
115 | export type MVideoAccountDefault = MVideo & | 131 | export type MVideoAccountDefault = |
132 | MVideo & | ||
116 | Use<'VideoChannel', MChannelAccountDefault> | 133 | Use<'VideoChannel', MChannelAccountDefault> |
117 | 134 | ||
118 | export type MVideoThumbnailAccountDefault = MVideo & | 135 | export type MVideoThumbnailAccountDefault = |
136 | MVideo & | ||
119 | Use<'Thumbnails', MThumbnail[]> & | 137 | Use<'Thumbnails', MThumbnail[]> & |
120 | Use<'VideoChannel', MChannelAccountDefault> | 138 | Use<'VideoChannel', MChannelAccountDefault> |
121 | 139 | ||
122 | export type MVideoWithChannelActor = MVideo & | 140 | export type MVideoWithChannelActor = |
141 | MVideo & | ||
123 | Use<'VideoChannel', MChannelActor> | 142 | Use<'VideoChannel', MChannelActor> |
124 | 143 | ||
125 | export type MVideoFullLight = MVideo & | 144 | export type MVideoFullLight = |
145 | MVideo & | ||
126 | Use<'Thumbnails', MThumbnail[]> & | 146 | Use<'Thumbnails', MThumbnail[]> & |
127 | Use<'VideoBlacklist', MVideoBlacklistLight> & | 147 | Use<'VideoBlacklist', MVideoBlacklistLight> & |
128 | Use<'Tags', MTag[]> & | 148 | Use<'Tags', MTag[]> & |
@@ -136,7 +156,8 @@ export type MVideoFullLight = MVideo & | |||
136 | 156 | ||
137 | // API | 157 | // API |
138 | 158 | ||
139 | export type MVideoAP = MVideo & | 159 | export type MVideoAP = |
160 | MVideo & | ||
140 | Use<'Tags', MTag[]> & | 161 | Use<'Tags', MTag[]> & |
141 | Use<'VideoChannel', MChannelAccountLight> & | 162 | Use<'VideoChannel', MChannelAccountLight> & |
142 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & | 163 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & |
@@ -147,7 +168,8 @@ export type MVideoAP = MVideo & | |||
147 | 168 | ||
148 | export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'> | 169 | export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'> |
149 | 170 | ||
150 | export type MVideoDetails = MVideo & | 171 | export type MVideoDetails = |
172 | MVideo & | ||
151 | Use<'VideoBlacklist', MVideoBlacklistLight> & | 173 | Use<'VideoBlacklist', MVideoBlacklistLight> & |
152 | Use<'Tags', MTag[]> & | 174 | Use<'Tags', MTag[]> & |
153 | Use<'VideoChannel', MChannelAccountLight> & | 175 | Use<'VideoChannel', MChannelAccountLight> & |
@@ -157,13 +179,15 @@ export type MVideoDetails = MVideo & | |||
157 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> & | 179 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> & |
158 | Use<'VideoFiles', MVideoFileRedundanciesOpt[]> | 180 | Use<'VideoFiles', MVideoFileRedundanciesOpt[]> |
159 | 181 | ||
160 | export type MVideoForUser = MVideo & | 182 | export type MVideoForUser = |
183 | MVideo & | ||
161 | Use<'VideoChannel', MChannelAccountDefault> & | 184 | Use<'VideoChannel', MChannelAccountDefault> & |
162 | Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & | 185 | Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & |
163 | Use<'VideoBlacklist', MVideoBlacklistLight> & | 186 | Use<'VideoBlacklist', MVideoBlacklistLight> & |
164 | Use<'Thumbnails', MThumbnail[]> | 187 | Use<'Thumbnails', MThumbnail[]> |
165 | 188 | ||
166 | export type MVideoForRedundancyAPI = MVideo & | 189 | export type MVideoForRedundancyAPI = |
190 | MVideo & | ||
167 | Use<'VideoFiles', MVideoFileRedundanciesAll[]> & | 191 | Use<'VideoFiles', MVideoFileRedundanciesAll[]> & |
168 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]> | 192 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]> |
169 | 193 | ||
@@ -171,13 +195,15 @@ export type MVideoForRedundancyAPI = MVideo & | |||
171 | 195 | ||
172 | // Format for API or AP object | 196 | // Format for API or AP object |
173 | 197 | ||
174 | export type MVideoFormattable = MVideo & | 198 | export type MVideoFormattable = |
199 | MVideo & | ||
175 | PickWithOpt<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]> & | 200 | PickWithOpt<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]> & |
176 | Use<'VideoChannel', MChannelAccountSummaryFormattable> & | 201 | Use<'VideoChannel', MChannelAccountSummaryFormattable> & |
177 | PickWithOpt<VideoModel, 'ScheduleVideoUpdate', Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'>> & | 202 | PickWithOpt<VideoModel, 'ScheduleVideoUpdate', Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'>> & |
178 | PickWithOpt<VideoModel, 'VideoBlacklist', Pick<MVideoBlacklist, 'reason'>> | 203 | PickWithOpt<VideoModel, 'VideoBlacklist', Pick<MVideoBlacklist, 'reason'>> |
179 | 204 | ||
180 | export type MVideoFormattableDetails = MVideoFormattable & | 205 | export type MVideoFormattableDetails = |
206 | MVideoFormattable & | ||
181 | Use<'VideoChannel', MChannelFormattable> & | 207 | Use<'VideoChannel', MChannelFormattable> & |
182 | Use<'Tags', MTag[]> & | 208 | Use<'Tags', MTag[]> & |
183 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesOpt[]> & | 209 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesOpt[]> & |