]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/typings/models/video/video.ts
Add url field in caption and use it for thumbnails
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video.ts
index 9a53bd337cf5245b1cb06630dd2e9c8479bc1940..82d76f40ca5dc68e50c8d507218c6f03e5c371db 100644 (file)
@@ -9,9 +9,14 @@ import {
   MChannelUserId
 } from './video-channels'
 import { MTag } from './tag'
-import { MVideoCaptionLanguage } from './video-caption'
-import { MStreamingPlaylist, MStreamingPlaylistRedundancies, MStreamingPlaylistRedundanciesOpt } from './video-streaming-playlist'
-import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file'
+import { MVideoCaptionLanguage, MVideoCaptionLanguageUrl } from './video-caption'
+import {
+  MStreamingPlaylistFiles,
+  MStreamingPlaylistRedundancies,
+  MStreamingPlaylistRedundanciesAll,
+  MStreamingPlaylistRedundanciesOpt
+} from './video-streaming-playlist'
+import { MVideoFile, MVideoFileRedundanciesAll, MVideoFileRedundanciesOpt } from './video-file'
 import { MThumbnail } from './thumbnail'
 import { MVideoBlacklist, MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist'
 import { MScheduleVideoUpdate } from './schedule-video-update'
@@ -40,7 +45,8 @@ export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'>
 
 // "With" to not confuse with the VideoFile model
 export type MVideoWithFile = MVideo &
-  Use<'VideoFiles', MVideoFile[]>
+  Use<'VideoFiles', MVideoFile[]> &
+  Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>
 
 export type MVideoThumbnail = MVideo &
   Use<'Thumbnails', MThumbnail[]>
@@ -66,7 +72,7 @@ export type MVideoWithCaptions = MVideo &
   Use<'VideoCaptions', MVideoCaptionLanguage[]>
 
 export type MVideoWithStreamingPlaylist = MVideo &
-  Use<'VideoStreamingPlaylists', MStreamingPlaylist[]>
+  Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>
 
 // ############################################################################
 
@@ -93,12 +99,12 @@ export type MVideoWithRights = MVideo &
 export type MVideoWithAllFiles = MVideo &
   Use<'VideoFiles', MVideoFile[]> &
   Use<'Thumbnails', MThumbnail[]> &
-  Use<'VideoStreamingPlaylists', MStreamingPlaylist[]>
+  Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>
 
 export type MVideoAccountLightBlacklistAllFiles = MVideo &
   Use<'VideoFiles', MVideoFile[]> &
   Use<'Thumbnails', MThumbnail[]> &
-  Use<'VideoStreamingPlaylists', MStreamingPlaylist[]> &
+  Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> &
   Use<'VideoChannel', MChannelAccountLight> &
   Use<'VideoBlacklist', MVideoBlacklistLight>
 
@@ -124,7 +130,7 @@ export type MVideoFullLight = MVideo &
   Use<'UserVideoHistories', MUserVideoHistoryTime[]> &
   Use<'VideoFiles', MVideoFile[]> &
   Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> &
-  Use<'VideoStreamingPlaylists', MStreamingPlaylist[]>
+  Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>
 
 // ############################################################################
 
@@ -133,10 +139,11 @@ export type MVideoFullLight = MVideo &
 export type MVideoAP = MVideo &
   Use<'Tags', MTag[]> &
   Use<'VideoChannel', MChannelAccountLight> &
-  Use<'VideoStreamingPlaylists', MStreamingPlaylist[]> &
-  Use<'VideoCaptions', MVideoCaptionLanguage[]> &
+  Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> &
+  Use<'VideoCaptions', MVideoCaptionLanguageUrl[]> &
   Use<'VideoBlacklist', MVideoBlacklistUnfederated> &
-  Use<'VideoFiles', MVideoFileRedundanciesOpt[]>
+  Use<'VideoFiles', MVideoFileRedundanciesOpt[]> &
+  Use<'Thumbnails', MThumbnail[]>
 
 export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'>
 
@@ -156,6 +163,10 @@ export type MVideoForUser = MVideo &
   Use<'VideoBlacklist', MVideoBlacklistLight> &
   Use<'Thumbnails', MThumbnail[]>
 
+export type MVideoForRedundancyAPI = MVideo &
+  Use<'VideoFiles', MVideoFileRedundanciesAll[]> &
+  Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]>
+
 // ############################################################################
 
 // Format for API or AP object