diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-18 10:45:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-06-18 10:46:27 +0200 |
commit | 26d6bf6533023326fa017812cf31bbe20c752d36 (patch) | |
tree | 9c4e3ecdc344420190f17d429bdf05d78fae7a8c /server/typings/models/video | |
parent | d6d951ddc0c492f3261065b5dcb4df0534d252fc (diff) | |
download | PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.tar.gz PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.tar.zst PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.zip |
Split types and typings
Diffstat (limited to 'server/typings/models/video')
19 files changed, 0 insertions, 937 deletions
diff --git a/server/typings/models/video/index.ts b/server/typings/models/video/index.ts deleted file mode 100644 index bd69c8a4b..000000000 --- a/server/typings/models/video/index.ts +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | export * from './schedule-video-update' | ||
2 | export * from './tag' | ||
3 | export * from './thumbnail' | ||
4 | export * from './video' | ||
5 | export * from './video-abuse' | ||
6 | export * from './video-blacklist' | ||
7 | export * from './video-caption' | ||
8 | export * from './video-change-ownership' | ||
9 | export * from './video-channels' | ||
10 | export * from './video-comment' | ||
11 | export * from './video-file' | ||
12 | export * from './video-import' | ||
13 | export * from './video-playlist' | ||
14 | export * from './video-playlist-element' | ||
15 | export * from './video-rate' | ||
16 | export * from './video-redundancy' | ||
17 | export * from './video-share' | ||
18 | export * from './video-streaming-playlist' | ||
diff --git a/server/typings/models/video/schedule-video-update.ts b/server/typings/models/video/schedule-video-update.ts deleted file mode 100644 index 95a53d139..000000000 --- a/server/typings/models/video/schedule-video-update.ts +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' | ||
2 | import { PickWith } from '@server/typings/utils' | ||
3 | import { MVideoAPWithoutCaption, MVideoWithBlacklistLight } from './video' | ||
4 | |||
5 | type Use<K extends keyof ScheduleVideoUpdateModel, M> = PickWith<ScheduleVideoUpdateModel, K, M> | ||
6 | |||
7 | // ############################################################################ | ||
8 | |||
9 | export type MScheduleVideoUpdate = Omit<ScheduleVideoUpdateModel, 'Video'> | ||
10 | |||
11 | // ############################################################################ | ||
12 | |||
13 | export type MScheduleVideoUpdateVideoAll = | ||
14 | MScheduleVideoUpdate & | ||
15 | Use<'Video', MVideoAPWithoutCaption & MVideoWithBlacklistLight> | ||
16 | |||
17 | // Format for API or AP object | ||
18 | |||
19 | export type MScheduleVideoUpdateFormattable = Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'> | ||
diff --git a/server/typings/models/video/tag.ts b/server/typings/models/video/tag.ts deleted file mode 100644 index 64a68873e..000000000 --- a/server/typings/models/video/tag.ts +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | import { TagModel } from '../../../models/video/tag' | ||
2 | |||
3 | export type MTag = Omit<TagModel, 'Videos'> | ||
diff --git a/server/typings/models/video/thumbnail.ts b/server/typings/models/video/thumbnail.ts deleted file mode 100644 index c03ba55ac..000000000 --- a/server/typings/models/video/thumbnail.ts +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | import { ThumbnailModel } from '../../../models/video/thumbnail' | ||
2 | |||
3 | export type MThumbnail = Omit<ThumbnailModel, 'Video' | 'VideoPlaylist'> | ||
diff --git a/server/typings/models/video/video-abuse.ts b/server/typings/models/video/video-abuse.ts deleted file mode 100644 index d60f05e4c..000000000 --- a/server/typings/models/video/video-abuse.ts +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | import { VideoAbuseModel } from '../../../models/video/video-abuse' | ||
2 | import { PickWith } from '../../utils' | ||
3 | import { MVideoAccountLightBlacklistAllFiles, MVideo } from './video' | ||
4 | import { MAccountDefault, MAccountFormattable } from '../account' | ||
5 | |||
6 | type Use<K extends keyof VideoAbuseModel, M> = PickWith<VideoAbuseModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MVideoAbuse = Omit<VideoAbuseModel, 'Account' | 'Video' | 'toActivityPubObject'> | ||
11 | |||
12 | // ############################################################################ | ||
13 | |||
14 | export type MVideoAbuseId = Pick<VideoAbuseModel, 'id'> | ||
15 | |||
16 | export type MVideoAbuseVideo = | ||
17 | MVideoAbuse & | ||
18 | Pick<VideoAbuseModel, 'toActivityPubObject'> & | ||
19 | Use<'Video', MVideo> | ||
20 | |||
21 | export type MVideoAbuseAccountVideo = | ||
22 | MVideoAbuse & | ||
23 | Pick<VideoAbuseModel, 'toActivityPubObject'> & | ||
24 | Use<'Video', MVideoAccountLightBlacklistAllFiles> & | ||
25 | Use<'Account', MAccountDefault> | ||
26 | |||
27 | // ############################################################################ | ||
28 | |||
29 | // Format for API or AP object | ||
30 | |||
31 | export type MVideoAbuseFormattable = | ||
32 | MVideoAbuse & | ||
33 | Use<'Account', MAccountFormattable> & | ||
34 | Use<'Video', Pick<MVideoAccountLightBlacklistAllFiles, | ||
35 | 'id' | 'uuid' | 'name' | 'nsfw' | 'getMiniatureStaticPath' | 'isBlacklisted' | 'VideoChannel'>> | ||
diff --git a/server/typings/models/video/video-blacklist.ts b/server/typings/models/video/video-blacklist.ts deleted file mode 100644 index ddb4db832..000000000 --- a/server/typings/models/video/video-blacklist.ts +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' | ||
2 | import { PickWith } from '@server/typings/utils' | ||
3 | import { MVideo, MVideoFormattable } from './video' | ||
4 | |||
5 | type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M> | ||
6 | |||
7 | // ############################################################################ | ||
8 | |||
9 | export type MVideoBlacklist = Omit<VideoBlacklistModel, 'Video'> | ||
10 | |||
11 | export type MVideoBlacklistLight = Pick<MVideoBlacklist, 'id' | 'reason' | 'unfederated'> | ||
12 | export type MVideoBlacklistUnfederated = Pick<MVideoBlacklist, 'unfederated'> | ||
13 | |||
14 | // ############################################################################ | ||
15 | |||
16 | export type MVideoBlacklistLightVideo = | ||
17 | MVideoBlacklistLight & | ||
18 | Use<'Video', MVideo> | ||
19 | |||
20 | export type MVideoBlacklistVideo = | ||
21 | MVideoBlacklist & | ||
22 | Use<'Video', MVideo> | ||
23 | |||
24 | // ############################################################################ | ||
25 | |||
26 | // Format for API or AP object | ||
27 | |||
28 | export type MVideoBlacklistFormattable = | ||
29 | MVideoBlacklist & | ||
30 | Use<'Video', MVideoFormattable> | ||
diff --git a/server/typings/models/video/video-caption.ts b/server/typings/models/video/video-caption.ts deleted file mode 100644 index e7aff6956..000000000 --- a/server/typings/models/video/video-caption.ts +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | import { VideoCaptionModel } from '../../../models/video/video-caption' | ||
2 | import { FunctionProperties, PickWith } from '@server/typings/utils' | ||
3 | import { MVideo, MVideoUUID } from './video' | ||
4 | |||
5 | type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M> | ||
6 | |||
7 | // ############################################################################ | ||
8 | |||
9 | export type MVideoCaption = Omit<VideoCaptionModel, 'Video'> | ||
10 | |||
11 | // ############################################################################ | ||
12 | |||
13 | export type MVideoCaptionLanguage = Pick<MVideoCaption, 'language'> | ||
14 | export type MVideoCaptionLanguageUrl = Pick<MVideoCaption, 'language' | 'fileUrl' | 'getFileUrl'> | ||
15 | |||
16 | export type MVideoCaptionVideo = | ||
17 | MVideoCaption & | ||
18 | Use<'Video', Pick<MVideo, 'id' | 'remote' | 'uuid'>> | ||
19 | |||
20 | // ############################################################################ | ||
21 | |||
22 | // Format for API or AP object | ||
23 | |||
24 | export type MVideoCaptionFormattable = | ||
25 | FunctionProperties<MVideoCaption> & | ||
26 | Pick<MVideoCaption, 'language'> & | ||
27 | Use<'Video', MVideoUUID> | ||
diff --git a/server/typings/models/video/video-change-ownership.ts b/server/typings/models/video/video-change-ownership.ts deleted file mode 100644 index 971dc3db5..000000000 --- a/server/typings/models/video/video-change-ownership.ts +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' | ||
2 | import { PickWith } from '@server/typings/utils' | ||
3 | import { MAccountDefault, MAccountFormattable } from '../account/account' | ||
4 | import { MVideo, MVideoWithAllFiles } from './video' | ||
5 | |||
6 | type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'> | ||
11 | |||
12 | export type MVideoChangeOwnershipFull = | ||
13 | MVideoChangeOwnership & | ||
14 | Use<'Initiator', MAccountDefault> & | ||
15 | Use<'NextOwner', MAccountDefault> & | ||
16 | Use<'Video', MVideoWithAllFiles> | ||
17 | |||
18 | // ############################################################################ | ||
19 | |||
20 | // Format for API or AP object | ||
21 | |||
22 | export type MVideoChangeOwnershipFormattable = | ||
23 | Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> & | ||
24 | Use<'Initiator', MAccountFormattable> & | ||
25 | Use<'NextOwner', MAccountFormattable> & | ||
26 | Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>> | ||
diff --git a/server/typings/models/video/video-channels.ts b/server/typings/models/video/video-channels.ts deleted file mode 100644 index 50f7c2d8a..000000000 --- a/server/typings/models/video/video-channels.ts +++ /dev/null | |||
@@ -1,145 +0,0 @@ | |||
1 | import { FunctionProperties, PickWith, PickWithOpt } from '../../utils' | ||
2 | import { VideoChannelModel } from '../../../models/video/video-channel' | ||
3 | import { | ||
4 | MAccountActor, | ||
5 | MAccountAPI, | ||
6 | MAccountDefault, | ||
7 | MAccountFormattable, | ||
8 | MAccountLight, | ||
9 | MAccountSummaryBlocks, | ||
10 | MAccountSummaryFormattable, | ||
11 | MAccountUrl, | ||
12 | MAccountUserId, | ||
13 | MActor, | ||
14 | MActorAccountChannelId, | ||
15 | MActorAP, | ||
16 | MActorAPI, | ||
17 | MActorDefault, | ||
18 | MActorDefaultLight, | ||
19 | MActorFormattable, | ||
20 | MActorLight, | ||
21 | MActorSummary, | ||
22 | MActorSummaryFormattable, MActorUrl | ||
23 | } from '../account' | ||
24 | import { MVideo } from './video' | ||
25 | |||
26 | type Use<K extends keyof VideoChannelModel, M> = PickWith<VideoChannelModel, K, M> | ||
27 | |||
28 | // ############################################################################ | ||
29 | |||
30 | export type MChannel = Omit<VideoChannelModel, 'Actor' | 'Account' | 'Videos' | 'VideoPlaylists'> | ||
31 | |||
32 | // ############################################################################ | ||
33 | |||
34 | export type MChannelId = Pick<MChannel, 'id'> | ||
35 | |||
36 | // ############################################################################ | ||
37 | |||
38 | export type MChannelIdActor = | ||
39 | MChannelId & | ||
40 | Use<'Actor', MActorAccountChannelId> | ||
41 | |||
42 | export type MChannelUserId = | ||
43 | Pick<MChannel, 'accountId'> & | ||
44 | Use<'Account', MAccountUserId> | ||
45 | |||
46 | export type MChannelActor = | ||
47 | MChannel & | ||
48 | Use<'Actor', MActor> | ||
49 | |||
50 | export type MChannelUrl = Use<'Actor', MActorUrl> | ||
51 | |||
52 | // Default scope | ||
53 | export type MChannelDefault = | ||
54 | MChannel & | ||
55 | Use<'Actor', MActorDefault> | ||
56 | |||
57 | // ############################################################################ | ||
58 | |||
59 | // Not all association attributes | ||
60 | |||
61 | export type MChannelLight = | ||
62 | MChannel & | ||
63 | Use<'Actor', MActorDefaultLight> | ||
64 | |||
65 | export type MChannelActorLight = | ||
66 | MChannel & | ||
67 | Use<'Actor', MActorLight> | ||
68 | |||
69 | export type MChannelAccountLight = | ||
70 | MChannel & | ||
71 | Use<'Actor', MActorDefaultLight> & | ||
72 | Use<'Account', MAccountLight> | ||
73 | |||
74 | // ############################################################################ | ||
75 | |||
76 | // Account associations | ||
77 | |||
78 | export type MChannelAccountActor = | ||
79 | MChannel & | ||
80 | Use<'Account', MAccountActor> | ||
81 | |||
82 | export type MChannelAccountDefault = | ||
83 | MChannel & | ||
84 | Use<'Actor', MActorDefault> & | ||
85 | Use<'Account', MAccountDefault> | ||
86 | |||
87 | export type MChannelActorAccountActor = | ||
88 | MChannel & | ||
89 | Use<'Account', MAccountActor> & | ||
90 | Use<'Actor', MActor> | ||
91 | |||
92 | // ############################################################################ | ||
93 | |||
94 | // Videos associations | ||
95 | export type MChannelVideos = | ||
96 | MChannel & | ||
97 | Use<'Videos', MVideo[]> | ||
98 | |||
99 | export type MChannelActorAccountDefaultVideos = | ||
100 | MChannel & | ||
101 | Use<'Actor', MActorDefault> & | ||
102 | Use<'Account', MAccountDefault> & | ||
103 | Use<'Videos', MVideo[]> | ||
104 | |||
105 | // ############################################################################ | ||
106 | |||
107 | // For API | ||
108 | |||
109 | export type MChannelSummary = | ||
110 | FunctionProperties<MChannel> & | ||
111 | Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> & | ||
112 | Use<'Actor', MActorSummary> | ||
113 | |||
114 | export type MChannelSummaryAccount = | ||
115 | MChannelSummary & | ||
116 | Use<'Account', MAccountSummaryBlocks> | ||
117 | |||
118 | export type MChannelAPI = | ||
119 | MChannel & | ||
120 | Use<'Actor', MActorAPI> & | ||
121 | Use<'Account', MAccountAPI> | ||
122 | |||
123 | // ############################################################################ | ||
124 | |||
125 | // Format for API or AP object | ||
126 | |||
127 | export type MChannelSummaryFormattable = | ||
128 | FunctionProperties<MChannel> & | ||
129 | Pick<MChannel, 'id' | 'name'> & | ||
130 | Use<'Actor', MActorSummaryFormattable> | ||
131 | |||
132 | export type MChannelAccountSummaryFormattable = | ||
133 | MChannelSummaryFormattable & | ||
134 | Use<'Account', MAccountSummaryFormattable> | ||
135 | |||
136 | export type MChannelFormattable = | ||
137 | FunctionProperties<MChannel> & | ||
138 | Pick<MChannel, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'support'> & | ||
139 | Use<'Actor', MActorFormattable> & | ||
140 | PickWithOpt<VideoChannelModel, 'Account', MAccountFormattable> | ||
141 | |||
142 | export type MChannelAP = | ||
143 | Pick<MChannel, 'name' | 'description' | 'support'> & | ||
144 | Use<'Actor', MActorAP> & | ||
145 | Use<'Account', MAccountUrl> | ||
diff --git a/server/typings/models/video/video-comment.ts b/server/typings/models/video/video-comment.ts deleted file mode 100644 index d6e0b66f5..000000000 --- a/server/typings/models/video/video-comment.ts +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | import { VideoCommentModel } from '../../../models/video/video-comment' | ||
2 | import { PickWith, PickWithOpt } from '../../utils' | ||
3 | import { MAccountDefault, MAccountFormattable, MAccountUrl } from '../account' | ||
4 | import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video' | ||
5 | |||
6 | type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MComment = Omit<VideoCommentModel, 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account'> | ||
11 | export type MCommentTotalReplies = MComment & { totalReplies?: number } | ||
12 | export type MCommentId = Pick<MComment, 'id'> | ||
13 | export type MCommentUrl = Pick<MComment, 'url'> | ||
14 | |||
15 | // ############################################################################ | ||
16 | |||
17 | export type MCommentOwner = | ||
18 | MComment & | ||
19 | Use<'Account', MAccountDefault> | ||
20 | |||
21 | export type MCommentVideo = | ||
22 | MComment & | ||
23 | Use<'Video', MVideoAccountLight> | ||
24 | |||
25 | export type MCommentReply = | ||
26 | MComment & | ||
27 | Use<'InReplyToVideoComment', MComment> | ||
28 | |||
29 | export type MCommentOwnerVideo = | ||
30 | MComment & | ||
31 | Use<'Account', MAccountDefault> & | ||
32 | Use<'Video', MVideoAccountLight> | ||
33 | |||
34 | export type MCommentOwnerVideoReply = | ||
35 | MComment & | ||
36 | Use<'Account', MAccountDefault> & | ||
37 | Use<'Video', MVideoAccountLight> & | ||
38 | Use<'InReplyToVideoComment', MComment> | ||
39 | |||
40 | export type MCommentOwnerReplyVideoLight = | ||
41 | MComment & | ||
42 | Use<'Account', MAccountDefault> & | ||
43 | Use<'InReplyToVideoComment', MComment> & | ||
44 | Use<'Video', MVideoIdUrl> | ||
45 | |||
46 | export type MCommentOwnerVideoFeed = | ||
47 | MCommentOwner & | ||
48 | Use<'Video', MVideoFeed> | ||
49 | |||
50 | // ############################################################################ | ||
51 | |||
52 | export type MCommentAPI = MComment & { totalReplies: number } | ||
53 | |||
54 | // ############################################################################ | ||
55 | |||
56 | // Format for API or AP object | ||
57 | |||
58 | export type MCommentFormattable = | ||
59 | MCommentTotalReplies & | ||
60 | Use<'Account', MAccountFormattable> | ||
61 | |||
62 | export type MCommentAP = | ||
63 | MComment & | ||
64 | Use<'Account', MAccountUrl> & | ||
65 | PickWithOpt<VideoCommentModel, 'Video', MVideoUrl> & | ||
66 | PickWithOpt<VideoCommentModel, 'InReplyToVideoComment', MCommentUrl> | ||
diff --git a/server/typings/models/video/video-file.ts b/server/typings/models/video/video-file.ts deleted file mode 100644 index 3fcaca78f..000000000 --- a/server/typings/models/video/video-file.ts +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | import { VideoFileModel } from '../../../models/video/video-file' | ||
2 | import { PickWith, PickWithOpt } from '../../utils' | ||
3 | import { MVideo, MVideoUUID } from './video' | ||
4 | import { MVideoRedundancy, MVideoRedundancyFileUrl } from './video-redundancy' | ||
5 | import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist' | ||
6 | |||
7 | type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M> | ||
8 | |||
9 | // ############################################################################ | ||
10 | |||
11 | export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos' | 'VideoStreamingPlaylist'> | ||
12 | |||
13 | export type MVideoFileVideo = | ||
14 | MVideoFile & | ||
15 | Use<'Video', MVideo> | ||
16 | |||
17 | export type MVideoFileStreamingPlaylist = | ||
18 | MVideoFile & | ||
19 | Use<'VideoStreamingPlaylist', MStreamingPlaylist> | ||
20 | |||
21 | export type MVideoFileStreamingPlaylistVideo = | ||
22 | MVideoFile & | ||
23 | Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> | ||
24 | |||
25 | export type MVideoFileVideoUUID = | ||
26 | MVideoFile & | ||
27 | Use<'Video', MVideoUUID> | ||
28 | |||
29 | export type MVideoFileRedundanciesAll = | ||
30 | MVideoFile & | ||
31 | PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancy[]> | ||
32 | |||
33 | export type MVideoFileRedundanciesOpt = | ||
34 | MVideoFile & | ||
35 | PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> | ||
36 | |||
37 | export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingPlaylist { | ||
38 | return !!file.videoStreamingPlaylistId | ||
39 | } | ||
40 | |||
41 | export function isWebtorrentFile (file: any): file is MVideoFileVideo { | ||
42 | return !!file.videoId | ||
43 | } | ||
diff --git a/server/typings/models/video/video-import.ts b/server/typings/models/video/video-import.ts deleted file mode 100644 index 4e5c2e4f0..000000000 --- a/server/typings/models/video/video-import.ts +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | import { VideoImportModel } from '@server/models/video/video-import' | ||
2 | import { PickWith, PickWithOpt } from '@server/typings/utils' | ||
3 | import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video' | ||
4 | import { MUser } from '../user/user' | ||
5 | |||
6 | type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'> | ||
11 | |||
12 | export type MVideoImportVideo = | ||
13 | MVideoImport & | ||
14 | Use<'Video', MVideo> | ||
15 | |||
16 | // ############################################################################ | ||
17 | |||
18 | type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnail | ||
19 | |||
20 | export type MVideoImportDefault = | ||
21 | MVideoImport & | ||
22 | Use<'User', MUser> & | ||
23 | Use<'Video', VideoAssociation> | ||
24 | |||
25 | export type MVideoImportDefaultFiles = | ||
26 | MVideoImport & | ||
27 | Use<'User', MUser> & | ||
28 | Use<'Video', VideoAssociation & MVideoWithFile> | ||
29 | |||
30 | // ############################################################################ | ||
31 | |||
32 | // Format for API or AP object | ||
33 | |||
34 | export type MVideoImportFormattable = | ||
35 | MVideoImport & | ||
36 | PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag> | ||
diff --git a/server/typings/models/video/video-playlist-element.ts b/server/typings/models/video/video-playlist-element.ts deleted file mode 100644 index f33c76594..000000000 --- a/server/typings/models/video/video-playlist-element.ts +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' | ||
2 | import { PickWith } from '@server/typings/utils' | ||
3 | import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video' | ||
4 | import { MVideoPlaylistPrivacy } from './video-playlist' | ||
5 | |||
6 | type Use<K extends keyof VideoPlaylistElementModel, M> = PickWith<VideoPlaylistElementModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MVideoPlaylistElement = Omit<VideoPlaylistElementModel, 'VideoPlaylist' | 'Video'> | ||
11 | |||
12 | // ############################################################################ | ||
13 | |||
14 | export type MVideoPlaylistElementId = Pick<MVideoPlaylistElement, 'id'> | ||
15 | |||
16 | export type MVideoPlaylistElementLight = Pick<MVideoPlaylistElement, 'id' | 'videoId' | 'startTimestamp' | 'stopTimestamp'> | ||
17 | |||
18 | // ############################################################################ | ||
19 | |||
20 | export type MVideoPlaylistVideoThumbnail = | ||
21 | MVideoPlaylistElement & | ||
22 | Use<'Video', MVideoThumbnail> | ||
23 | |||
24 | export type MVideoPlaylistElementVideoUrlPlaylistPrivacy = | ||
25 | MVideoPlaylistElement & | ||
26 | Use<'Video', MVideoUrl> & | ||
27 | Use<'VideoPlaylist', MVideoPlaylistPrivacy> | ||
28 | |||
29 | // ############################################################################ | ||
30 | |||
31 | // Format for API or AP object | ||
32 | |||
33 | export type MVideoPlaylistElementFormattable = | ||
34 | MVideoPlaylistElement & | ||
35 | Use<'Video', MVideoFormattable> | ||
36 | |||
37 | export type MVideoPlaylistElementAP = | ||
38 | MVideoPlaylistElement & | ||
39 | Use<'Video', MVideoUrl> | ||
diff --git a/server/typings/models/video/video-playlist.ts b/server/typings/models/video/video-playlist.ts deleted file mode 100644 index 49c27f4a7..000000000 --- a/server/typings/models/video/video-playlist.ts +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' | ||
2 | import { PickWith } from '../../utils' | ||
3 | import { MAccount, MAccountDefault, MAccountSummary, MAccountSummaryFormattable } from '../account' | ||
4 | import { MThumbnail } from './thumbnail' | ||
5 | import { MChannelDefault, MChannelSummary, MChannelSummaryFormattable, MChannelUrl } from './video-channels' | ||
6 | import { MVideoPlaylistElementLight } from '@server/typings/models/video/video-playlist-element' | ||
7 | |||
8 | type Use<K extends keyof VideoPlaylistModel, M> = PickWith<VideoPlaylistModel, K, M> | ||
9 | |||
10 | // ############################################################################ | ||
11 | |||
12 | export type MVideoPlaylist = Omit<VideoPlaylistModel, 'OwnerAccount' | 'VideoChannel' | 'VideoPlaylistElements' | 'Thumbnail'> | ||
13 | |||
14 | // ############################################################################ | ||
15 | |||
16 | export type MVideoPlaylistId = Pick<MVideoPlaylist, 'id'> | ||
17 | export type MVideoPlaylistPrivacy = Pick<MVideoPlaylist, 'privacy'> | ||
18 | export type MVideoPlaylistUUID = Pick<MVideoPlaylist, 'uuid'> | ||
19 | export type MVideoPlaylistVideosLength = MVideoPlaylist & { videosLength?: number } | ||
20 | |||
21 | // ############################################################################ | ||
22 | |||
23 | // With elements | ||
24 | |||
25 | export type MVideoPlaylistWithElements = | ||
26 | MVideoPlaylist & | ||
27 | Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]> | ||
28 | |||
29 | export type MVideoPlaylistIdWithElements = | ||
30 | MVideoPlaylistId & | ||
31 | Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]> | ||
32 | |||
33 | // ############################################################################ | ||
34 | |||
35 | // With account | ||
36 | |||
37 | export type MVideoPlaylistOwner = | ||
38 | MVideoPlaylist & | ||
39 | Use<'OwnerAccount', MAccount> | ||
40 | |||
41 | export type MVideoPlaylistOwnerDefault = | ||
42 | MVideoPlaylist & | ||
43 | Use<'OwnerAccount', MAccountDefault> | ||
44 | |||
45 | // ############################################################################ | ||
46 | |||
47 | // With thumbnail | ||
48 | |||
49 | export type MVideoPlaylistThumbnail = | ||
50 | MVideoPlaylist & | ||
51 | Use<'Thumbnail', MThumbnail> | ||
52 | |||
53 | export type MVideoPlaylistAccountThumbnail = | ||
54 | MVideoPlaylist & | ||
55 | Use<'OwnerAccount', MAccountDefault> & | ||
56 | Use<'Thumbnail', MThumbnail> | ||
57 | |||
58 | // ############################################################################ | ||
59 | |||
60 | // With channel | ||
61 | |||
62 | export type MVideoPlaylistAccountChannelDefault = | ||
63 | MVideoPlaylist & | ||
64 | Use<'OwnerAccount', MAccountDefault> & | ||
65 | Use<'VideoChannel', MChannelDefault> | ||
66 | |||
67 | // ############################################################################ | ||
68 | |||
69 | // With all associations | ||
70 | |||
71 | export type MVideoPlaylistFull = | ||
72 | MVideoPlaylist & | ||
73 | Use<'OwnerAccount', MAccountDefault> & | ||
74 | Use<'VideoChannel', MChannelDefault> & | ||
75 | Use<'Thumbnail', MThumbnail> | ||
76 | |||
77 | // ############################################################################ | ||
78 | |||
79 | // For API | ||
80 | |||
81 | export type MVideoPlaylistAccountChannelSummary = | ||
82 | MVideoPlaylist & | ||
83 | Use<'OwnerAccount', MAccountSummary> & | ||
84 | Use<'VideoChannel', MChannelSummary> | ||
85 | |||
86 | export type MVideoPlaylistFullSummary = | ||
87 | MVideoPlaylist & | ||
88 | Use<'Thumbnail', MThumbnail> & | ||
89 | Use<'OwnerAccount', MAccountSummary> & | ||
90 | Use<'VideoChannel', MChannelSummary> | ||
91 | |||
92 | // ############################################################################ | ||
93 | |||
94 | // Format for API or AP object | ||
95 | |||
96 | export type MVideoPlaylistFormattable = | ||
97 | MVideoPlaylistVideosLength & | ||
98 | Use<'OwnerAccount', MAccountSummaryFormattable> & | ||
99 | Use<'VideoChannel', MChannelSummaryFormattable> | ||
100 | |||
101 | export type MVideoPlaylistAP = | ||
102 | MVideoPlaylist & | ||
103 | Use<'Thumbnail', MThumbnail> & | ||
104 | Use<'VideoChannel', MChannelUrl> | ||
diff --git a/server/typings/models/video/video-rate.ts b/server/typings/models/video/video-rate.ts deleted file mode 100644 index 64ce4965b..000000000 --- a/server/typings/models/video/video-rate.ts +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | import { AccountVideoRateModel } from '@server/models/account/account-video-rate' | ||
2 | import { PickWith } from '@server/typings/utils' | ||
3 | import { MAccountAudience, MAccountUrl } from '../account/account' | ||
4 | import { MVideo, MVideoFormattable } from './video' | ||
5 | |||
6 | type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MAccountVideoRate = Omit<AccountVideoRateModel, 'Video' | 'Account'> | ||
11 | |||
12 | export type MAccountVideoRateAccountUrl = | ||
13 | MAccountVideoRate & | ||
14 | Use<'Account', MAccountUrl> | ||
15 | |||
16 | export type MAccountVideoRateAccountVideo = | ||
17 | MAccountVideoRate & | ||
18 | Use<'Account', MAccountAudience> & | ||
19 | Use<'Video', MVideo> | ||
20 | |||
21 | // ############################################################################ | ||
22 | |||
23 | // Format for API or AP object | ||
24 | |||
25 | export type MAccountVideoRateFormattable = | ||
26 | Pick<MAccountVideoRate, 'type'> & | ||
27 | Use<'Video', MVideoFormattable> | ||
diff --git a/server/typings/models/video/video-redundancy.ts b/server/typings/models/video/video-redundancy.ts deleted file mode 100644 index 5107aa7f4..000000000 --- a/server/typings/models/video/video-redundancy.ts +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' | ||
2 | import { PickWith, PickWithOpt } from '@server/typings/utils' | ||
3 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' | ||
4 | import { VideoFileModel } from '@server/models/video/video-file' | ||
5 | import { MVideoFile, MVideoFileVideo } from './video-file' | ||
6 | import { MStreamingPlaylistVideo } from './video-streaming-playlist' | ||
7 | import { MVideoUrl } from './video' | ||
8 | |||
9 | type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M> | ||
10 | |||
11 | // ############################################################################ | ||
12 | |||
13 | export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'> | ||
14 | |||
15 | export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'> | ||
16 | |||
17 | // ############################################################################ | ||
18 | |||
19 | export type MVideoRedundancyFile = | ||
20 | MVideoRedundancy & | ||
21 | Use<'VideoFile', MVideoFile> | ||
22 | |||
23 | export type MVideoRedundancyFileVideo = | ||
24 | MVideoRedundancy & | ||
25 | Use<'VideoFile', MVideoFileVideo> | ||
26 | |||
27 | export type MVideoRedundancyStreamingPlaylistVideo = | ||
28 | MVideoRedundancy & | ||
29 | Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> | ||
30 | |||
31 | export type MVideoRedundancyVideo = | ||
32 | MVideoRedundancy & | ||
33 | Use<'VideoFile', MVideoFileVideo> & | ||
34 | Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> | ||
35 | |||
36 | // ############################################################################ | ||
37 | |||
38 | // Format for API or AP object | ||
39 | |||
40 | export type MVideoRedundancyAP = | ||
41 | MVideoRedundancy & | ||
42 | PickWithOpt<VideoRedundancyModel, 'VideoFile', MVideoFile & PickWith<VideoFileModel, 'Video', MVideoUrl>> & | ||
43 | PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>> | ||
diff --git a/server/typings/models/video/video-share.ts b/server/typings/models/video/video-share.ts deleted file mode 100644 index 50ca75d26..000000000 --- a/server/typings/models/video/video-share.ts +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | import { VideoShareModel } from '../../../models/video/video-share' | ||
2 | import { PickWith } from '../../utils' | ||
3 | import { MActorDefault } from '../account' | ||
4 | import { MVideo } from './video' | ||
5 | |||
6 | type Use<K extends keyof VideoShareModel, M> = PickWith<VideoShareModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MVideoShare = Omit<VideoShareModel, 'Actor' | 'Video'> | ||
11 | |||
12 | export type MVideoShareActor = | ||
13 | MVideoShare & | ||
14 | Use<'Actor', MActorDefault> | ||
15 | |||
16 | export type MVideoShareFull = | ||
17 | MVideoShare & | ||
18 | Use<'Actor', MActorDefault> & | ||
19 | Use<'Video', MVideo> | ||
diff --git a/server/typings/models/video/video-streaming-playlist.ts b/server/typings/models/video/video-streaming-playlist.ts deleted file mode 100644 index 3f54aa560..000000000 --- a/server/typings/models/video/video-streaming-playlist.ts +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' | ||
2 | import { PickWith, PickWithOpt } from '../../utils' | ||
3 | import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy' | ||
4 | import { MVideo } from './video' | ||
5 | import { MVideoFile } from './video-file' | ||
6 | |||
7 | type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M> | ||
8 | |||
9 | // ############################################################################ | ||
10 | |||
11 | export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'> | ||
12 | |||
13 | export type MStreamingPlaylistFiles = | ||
14 | MStreamingPlaylist & | ||
15 | Use<'VideoFiles', MVideoFile[]> | ||
16 | |||
17 | export type MStreamingPlaylistVideo = | ||
18 | MStreamingPlaylist & | ||
19 | Use<'Video', MVideo> | ||
20 | |||
21 | export type MStreamingPlaylistFilesVideo = | ||
22 | MStreamingPlaylist & | ||
23 | Use<'VideoFiles', MVideoFile[]> & | ||
24 | Use<'Video', MVideo> | ||
25 | |||
26 | export type MStreamingPlaylistRedundanciesAll = | ||
27 | MStreamingPlaylist & | ||
28 | Use<'VideoFiles', MVideoFile[]> & | ||
29 | Use<'RedundancyVideos', MVideoRedundancy[]> | ||
30 | |||
31 | export type MStreamingPlaylistRedundancies = | ||
32 | MStreamingPlaylist & | ||
33 | Use<'VideoFiles', MVideoFile[]> & | ||
34 | Use<'RedundancyVideos', MVideoRedundancyFileUrl[]> | ||
35 | |||
36 | export type MStreamingPlaylistRedundanciesOpt = | ||
37 | MStreamingPlaylist & | ||
38 | Use<'VideoFiles', MVideoFile[]> & | ||
39 | PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> | ||
40 | |||
41 | export function isStreamingPlaylist (value: MVideo | MStreamingPlaylistVideo): value is MStreamingPlaylistVideo { | ||
42 | return !!(value as MStreamingPlaylist).playlistUrl | ||
43 | } | ||
diff --git a/server/typings/models/video/video.ts b/server/typings/models/video/video.ts deleted file mode 100644 index 022a9566d..000000000 --- a/server/typings/models/video/video.ts +++ /dev/null | |||
@@ -1,211 +0,0 @@ | |||
1 | import { VideoModel } from '../../../models/video/video' | ||
2 | import { PickWith, PickWithOpt } from '../../utils' | ||
3 | import { | ||
4 | MChannelAccountDefault, | ||
5 | MChannelAccountLight, | ||
6 | MChannelAccountSummaryFormattable, | ||
7 | MChannelActor, | ||
8 | MChannelFormattable, | ||
9 | MChannelUserId | ||
10 | } from './video-channels' | ||
11 | import { MTag } from './tag' | ||
12 | import { MVideoCaptionLanguage, MVideoCaptionLanguageUrl } from './video-caption' | ||
13 | import { | ||
14 | MStreamingPlaylistFiles, | ||
15 | MStreamingPlaylistRedundancies, | ||
16 | MStreamingPlaylistRedundanciesAll, | ||
17 | MStreamingPlaylistRedundanciesOpt | ||
18 | } from './video-streaming-playlist' | ||
19 | import { MVideoFile, MVideoFileRedundanciesAll, MVideoFileRedundanciesOpt } from './video-file' | ||
20 | import { MThumbnail } from './thumbnail' | ||
21 | import { MVideoBlacklist, MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' | ||
22 | import { MScheduleVideoUpdate } from './schedule-video-update' | ||
23 | import { MUserVideoHistoryTime } from '../user/user-video-history' | ||
24 | |||
25 | type Use<K extends keyof VideoModel, M> = PickWith<VideoModel, K, M> | ||
26 | |||
27 | // ############################################################################ | ||
28 | |||
29 | export type MVideo = | ||
30 | Omit<VideoModel, 'VideoChannel' | 'Tags' | 'Thumbnails' | 'VideoPlaylistElements' | 'VideoAbuses' | | ||
31 | 'VideoFiles' | 'VideoStreamingPlaylists' | 'VideoShares' | 'AccountVideoRates' | 'VideoComments' | 'VideoViews' | 'UserVideoHistories' | | ||
32 | 'ScheduleVideoUpdate' | 'VideoBlacklist' | 'VideoImport' | 'VideoCaptions'> | ||
33 | |||
34 | // ############################################################################ | ||
35 | |||
36 | export type MVideoId = Pick<MVideo, 'id'> | ||
37 | export type MVideoUrl = Pick<MVideo, 'url'> | ||
38 | export type MVideoUUID = Pick<MVideo, 'uuid'> | ||
39 | |||
40 | export type MVideoImmutable = Pick<MVideo, 'id' | 'url' | 'uuid' | 'remote' | 'isOwned'> | ||
41 | export type MVideoIdUrl = MVideoId & MVideoUrl | ||
42 | export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'> | ||
43 | |||
44 | // ############################################################################ | ||
45 | |||
46 | // Video raw associations: schedules, video files, tags, thumbnails, captions, streaming playlists | ||
47 | |||
48 | // "With" to not confuse with the VideoFile model | ||
49 | export type MVideoWithFile = | ||
50 | MVideo & | ||
51 | Use<'VideoFiles', MVideoFile[]> & | ||
52 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> | ||
53 | |||
54 | export type MVideoThumbnail = | ||
55 | MVideo & | ||
56 | Use<'Thumbnails', MThumbnail[]> | ||
57 | |||
58 | export type MVideoIdThumbnail = | ||
59 | MVideoId & | ||
60 | Use<'Thumbnails', MThumbnail[]> | ||
61 | |||
62 | export type MVideoWithFileThumbnail = | ||
63 | MVideo & | ||
64 | Use<'VideoFiles', MVideoFile[]> & | ||
65 | Use<'Thumbnails', MThumbnail[]> | ||
66 | |||
67 | export type MVideoThumbnailBlacklist = | ||
68 | MVideo & | ||
69 | Use<'Thumbnails', MThumbnail[]> & | ||
70 | Use<'VideoBlacklist', MVideoBlacklistLight> | ||
71 | |||
72 | export type MVideoTag = | ||
73 | MVideo & | ||
74 | Use<'Tags', MTag[]> | ||
75 | |||
76 | export type MVideoWithSchedule = | ||
77 | MVideo & | ||
78 | PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate> | ||
79 | |||
80 | export type MVideoWithCaptions = | ||
81 | MVideo & | ||
82 | Use<'VideoCaptions', MVideoCaptionLanguage[]> | ||
83 | |||
84 | export type MVideoWithStreamingPlaylist = | ||
85 | MVideo & | ||
86 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> | ||
87 | |||
88 | // ############################################################################ | ||
89 | |||
90 | // Associations with not all their attributes | ||
91 | |||
92 | export type MVideoUserHistory = | ||
93 | MVideo & | ||
94 | Use<'UserVideoHistories', MUserVideoHistoryTime[]> | ||
95 | |||
96 | export type MVideoWithBlacklistLight = | ||
97 | MVideo & | ||
98 | Use<'VideoBlacklist', MVideoBlacklistLight> | ||
99 | |||
100 | export type MVideoAccountLight = | ||
101 | MVideo & | ||
102 | Use<'VideoChannel', MChannelAccountLight> | ||
103 | |||
104 | export type MVideoWithRights = | ||
105 | MVideo & | ||
106 | Use<'VideoBlacklist', MVideoBlacklistLight> & | ||
107 | Use<'Thumbnails', MThumbnail[]> & | ||
108 | Use<'VideoChannel', MChannelUserId> | ||
109 | |||
110 | // ############################################################################ | ||
111 | |||
112 | // All files with some additional associations | ||
113 | |||
114 | export type MVideoWithAllFiles = | ||
115 | MVideo & | ||
116 | Use<'VideoFiles', MVideoFile[]> & | ||
117 | Use<'Thumbnails', MThumbnail[]> & | ||
118 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> | ||
119 | |||
120 | export type MVideoAccountLightBlacklistAllFiles = | ||
121 | MVideo & | ||
122 | Use<'VideoFiles', MVideoFile[]> & | ||
123 | Use<'Thumbnails', MThumbnail[]> & | ||
124 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & | ||
125 | Use<'VideoChannel', MChannelAccountLight> & | ||
126 | Use<'VideoBlacklist', MVideoBlacklistLight> | ||
127 | |||
128 | // ############################################################################ | ||
129 | |||
130 | // With account | ||
131 | |||
132 | export type MVideoAccountDefault = | ||
133 | MVideo & | ||
134 | Use<'VideoChannel', MChannelAccountDefault> | ||
135 | |||
136 | export type MVideoThumbnailAccountDefault = | ||
137 | MVideo & | ||
138 | Use<'Thumbnails', MThumbnail[]> & | ||
139 | Use<'VideoChannel', MChannelAccountDefault> | ||
140 | |||
141 | export type MVideoWithChannelActor = | ||
142 | MVideo & | ||
143 | Use<'VideoChannel', MChannelActor> | ||
144 | |||
145 | export type MVideoFullLight = | ||
146 | MVideo & | ||
147 | Use<'Thumbnails', MThumbnail[]> & | ||
148 | Use<'VideoBlacklist', MVideoBlacklistLight> & | ||
149 | Use<'Tags', MTag[]> & | ||
150 | Use<'VideoChannel', MChannelAccountLight> & | ||
151 | Use<'UserVideoHistories', MUserVideoHistoryTime[]> & | ||
152 | Use<'VideoFiles', MVideoFile[]> & | ||
153 | Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & | ||
154 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> | ||
155 | |||
156 | // ############################################################################ | ||
157 | |||
158 | // API | ||
159 | |||
160 | export type MVideoAP = | ||
161 | MVideo & | ||
162 | Use<'Tags', MTag[]> & | ||
163 | Use<'VideoChannel', MChannelAccountLight> & | ||
164 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & | ||
165 | Use<'VideoCaptions', MVideoCaptionLanguageUrl[]> & | ||
166 | Use<'VideoBlacklist', MVideoBlacklistUnfederated> & | ||
167 | Use<'VideoFiles', MVideoFileRedundanciesOpt[]> & | ||
168 | Use<'Thumbnails', MThumbnail[]> | ||
169 | |||
170 | export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'> | ||
171 | |||
172 | export type MVideoDetails = | ||
173 | MVideo & | ||
174 | Use<'VideoBlacklist', MVideoBlacklistLight> & | ||
175 | Use<'Tags', MTag[]> & | ||
176 | Use<'VideoChannel', MChannelAccountLight> & | ||
177 | Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & | ||
178 | Use<'Thumbnails', MThumbnail[]> & | ||
179 | Use<'UserVideoHistories', MUserVideoHistoryTime[]> & | ||
180 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> & | ||
181 | Use<'VideoFiles', MVideoFileRedundanciesOpt[]> | ||
182 | |||
183 | export type MVideoForUser = | ||
184 | MVideo & | ||
185 | Use<'VideoChannel', MChannelAccountDefault> & | ||
186 | Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & | ||
187 | Use<'VideoBlacklist', MVideoBlacklistLight> & | ||
188 | Use<'Thumbnails', MThumbnail[]> | ||
189 | |||
190 | export type MVideoForRedundancyAPI = | ||
191 | MVideo & | ||
192 | Use<'VideoFiles', MVideoFileRedundanciesAll[]> & | ||
193 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]> | ||
194 | |||
195 | // ############################################################################ | ||
196 | |||
197 | // Format for API or AP object | ||
198 | |||
199 | export type MVideoFormattable = | ||
200 | MVideo & | ||
201 | PickWithOpt<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]> & | ||
202 | Use<'VideoChannel', MChannelAccountSummaryFormattable> & | ||
203 | PickWithOpt<VideoModel, 'ScheduleVideoUpdate', Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'>> & | ||
204 | PickWithOpt<VideoModel, 'VideoBlacklist', Pick<MVideoBlacklist, 'reason'>> | ||
205 | |||
206 | export type MVideoFormattableDetails = | ||
207 | MVideoFormattable & | ||
208 | Use<'VideoChannel', MChannelFormattable> & | ||
209 | Use<'Tags', MTag[]> & | ||
210 | Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesOpt[]> & | ||
211 | Use<'VideoFiles', MVideoFileRedundanciesOpt[]> | ||