diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-15 15:06:03 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-25 10:59:43 +0100 |
commit | d7a25329f9e607894d29ab342b9cb66638b56dc0 (patch) | |
tree | 6cd6bc4f2689f78944238b313c93427423a932ac /server/typings | |
parent | 14981d7331da3f63fe6cfaf020ccb7c910006eaf (diff) | |
download | PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.gz PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.zst PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.zip |
Add ability to disable webtorrent
In favour of HLS
Diffstat (limited to 'server/typings')
23 files changed, 73 insertions, 29 deletions
diff --git a/server/typings/models/account/account.ts b/server/typings/models/account/account.ts index ec78fece8..adb1f3689 100644 --- a/server/typings/models/account/account.ts +++ b/server/typings/models/account/account.ts | |||
@@ -15,7 +15,7 @@ import { | |||
15 | } from './actor' | 15 | } from './actor' |
16 | import { FunctionProperties, PickWith } from '../../utils' | 16 | import { FunctionProperties, PickWith } from '../../utils' |
17 | import { MAccountBlocklistId } from './account-blocklist' | 17 | import { MAccountBlocklistId } from './account-blocklist' |
18 | import { MChannelDefault } from '@server/typings/models' | 18 | import { MChannelDefault } from '../video/video-channels' |
19 | 19 | ||
20 | type Use<K extends keyof AccountModel, M> = PickWith<AccountModel, K, M> | 20 | type Use<K extends keyof AccountModel, M> = PickWith<AccountModel, K, M> |
21 | 21 | ||
diff --git a/server/typings/models/account/actor-follow.ts b/server/typings/models/account/actor-follow.ts index 1c66eb0a0..f44157eba 100644 --- a/server/typings/models/account/actor-follow.ts +++ b/server/typings/models/account/actor-follow.ts | |||
@@ -1,17 +1,16 @@ | |||
1 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | 1 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
2 | import { | 2 | import { |
3 | MActor, | 3 | MActor, |
4 | MActorAccount, | ||
5 | MActorDefaultAccountChannel, | ||
6 | MActorChannelAccountActor, | 4 | MActorChannelAccountActor, |
7 | MActorDefault, | 5 | MActorDefault, |
6 | MActorDefaultAccountChannel, | ||
8 | MActorFormattable, | 7 | MActorFormattable, |
9 | MActorHost, | 8 | MActorHost, |
10 | MActorUsername | 9 | MActorUsername |
11 | } from './actor' | 10 | } from './actor' |
12 | import { PickWith } from '../../utils' | 11 | import { PickWith } from '../../utils' |
13 | import { ActorModel } from '@server/models/activitypub/actor' | 12 | import { ActorModel } from '@server/models/activitypub/actor' |
14 | import { MChannelDefault } from '@server/typings/models' | 13 | import { MChannelDefault } from '../video/video-channels' |
15 | 14 | ||
16 | type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M> | 15 | type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M> |
17 | 16 | ||
diff --git a/server/typings/models/account/index.d.ts b/server/typings/models/account/index.ts index 513c09c40..513c09c40 100644 --- a/server/typings/models/account/index.d.ts +++ b/server/typings/models/account/index.ts | |||
diff --git a/server/typings/models/index.d.ts b/server/typings/models/index.ts index 78b4948ce..78b4948ce 100644 --- a/server/typings/models/index.d.ts +++ b/server/typings/models/index.ts | |||
diff --git a/server/typings/models/oauth/index.d.ts b/server/typings/models/oauth/index.ts index 36b7ea8ca..36b7ea8ca 100644 --- a/server/typings/models/oauth/index.d.ts +++ b/server/typings/models/oauth/index.ts | |||
diff --git a/server/typings/models/oauth/oauth-token.ts b/server/typings/models/oauth/oauth-token.ts index af3412925..8ef042d4e 100644 --- a/server/typings/models/oauth/oauth-token.ts +++ b/server/typings/models/oauth/oauth-token.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' | 1 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' |
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MUserAccountUrl } from '@server/typings/models' | 3 | import { MUserAccountUrl } from '../user/user' |
4 | 4 | ||
5 | type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M> | 5 | type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M> |
6 | 6 | ||
diff --git a/server/typings/models/server/index.d.ts b/server/typings/models/server/index.ts index c853795ad..c853795ad 100644 --- a/server/typings/models/server/index.d.ts +++ b/server/typings/models/server/index.ts | |||
diff --git a/server/typings/models/server/server-blocklist.ts b/server/typings/models/server/server-blocklist.ts index c81f604f5..c3e6230f2 100644 --- a/server/typings/models/server/server-blocklist.ts +++ b/server/typings/models/server/server-blocklist.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' | 1 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' |
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MAccountDefault, MAccountFormattable, MServer, MServerFormattable } from '@server/typings/models' | 3 | import { MAccountDefault, MAccountFormattable } from '../account/account' |
4 | import { MServer, MServerFormattable } from './server' | ||
4 | 5 | ||
5 | type Use<K extends keyof ServerBlocklistModel, M> = PickWith<ServerBlocklistModel, K, M> | 6 | type Use<K extends keyof ServerBlocklistModel, M> = PickWith<ServerBlocklistModel, K, M> |
6 | 7 | ||
diff --git a/server/typings/models/user/index.d.ts b/server/typings/models/user/index.ts index 6657b2128..6657b2128 100644 --- a/server/typings/models/user/index.d.ts +++ b/server/typings/models/user/index.ts | |||
diff --git a/server/typings/models/user/user.ts b/server/typings/models/user/user.ts index 52d6d4a05..a2750adc7 100644 --- a/server/typings/models/user/user.ts +++ b/server/typings/models/user/user.ts | |||
@@ -11,7 +11,7 @@ import { | |||
11 | } from '../account' | 11 | } from '../account' |
12 | import { MNotificationSetting, MNotificationSettingFormattable } from './user-notification-setting' | 12 | import { MNotificationSetting, MNotificationSettingFormattable } from './user-notification-setting' |
13 | import { AccountModel } from '@server/models/account/account' | 13 | import { AccountModel } from '@server/models/account/account' |
14 | import { MChannelFormattable } from '@server/typings/models' | 14 | import { MChannelFormattable } from '../video/video-channels' |
15 | 15 | ||
16 | type Use<K extends keyof UserModel, M> = PickWith<UserModel, K, M> | 16 | type Use<K extends keyof UserModel, M> = PickWith<UserModel, K, M> |
17 | 17 | ||
diff --git a/server/typings/models/video/index.d.ts b/server/typings/models/video/index.ts index bd69c8a4b..bd69c8a4b 100644 --- a/server/typings/models/video/index.d.ts +++ b/server/typings/models/video/index.ts | |||
diff --git a/server/typings/models/video/schedule-video-update.ts b/server/typings/models/video/schedule-video-update.ts index ada9af06e..e6f478cdf 100644 --- a/server/typings/models/video/schedule-video-update.ts +++ b/server/typings/models/video/schedule-video-update.ts | |||
@@ -1,9 +1,18 @@ | |||
1 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' | 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 | // ############################################################################ | ||
2 | 8 | ||
3 | export type MScheduleVideoUpdate = Omit<ScheduleVideoUpdateModel, 'Video'> | 9 | export type MScheduleVideoUpdate = Omit<ScheduleVideoUpdateModel, 'Video'> |
4 | 10 | ||
5 | // ############################################################################ | 11 | // ############################################################################ |
6 | 12 | ||
13 | export type MScheduleVideoUpdateVideoAll = MScheduleVideoUpdate & | ||
14 | Use<'Video', MVideoAPWithoutCaption & MVideoWithBlacklistLight> | ||
15 | |||
7 | // Format for API or AP object | 16 | // Format for API or AP object |
8 | 17 | ||
9 | export type MScheduleVideoUpdateFormattable = Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'> | 18 | export type MScheduleVideoUpdateFormattable = Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'> |
diff --git a/server/typings/models/video/video-blacklist.ts b/server/typings/models/video/video-blacklist.ts index e12880454..7122a9dc0 100644 --- a/server/typings/models/video/video-blacklist.ts +++ b/server/typings/models/video/video-blacklist.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' | 1 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' |
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MVideo, MVideoFormattable } from '@server/typings/models' | 3 | import { MVideo, MVideoFormattable } from './video' |
4 | 4 | ||
5 | type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M> | 5 | type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M> |
6 | 6 | ||
diff --git a/server/typings/models/video/video-caption.ts b/server/typings/models/video/video-caption.ts index 7cb2a2ad3..ffa56f544 100644 --- a/server/typings/models/video/video-caption.ts +++ b/server/typings/models/video/video-caption.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { VideoCaptionModel } from '../../../models/video/video-caption' | 1 | import { VideoCaptionModel } from '../../../models/video/video-caption' |
2 | import { FunctionProperties, PickWith } from '@server/typings/utils' | 2 | import { FunctionProperties, PickWith } from '@server/typings/utils' |
3 | import { MVideo, MVideoUUID } from '@server/typings/models' | 3 | import { MVideo, MVideoUUID } from './video' |
4 | 4 | ||
5 | type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M> | 5 | type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M> |
6 | 6 | ||
diff --git a/server/typings/models/video/video-change-ownership.ts b/server/typings/models/video/video-change-ownership.ts index 72634cdb2..e5b5bbc1d 100644 --- a/server/typings/models/video/video-change-ownership.ts +++ b/server/typings/models/video/video-change-ownership.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' | 1 | import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' |
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MAccountDefault, MAccountFormattable, MVideo, MVideoWithFileThumbnail } from '@server/typings/models' | 3 | import { MAccountDefault, MAccountFormattable } from '../account/account' |
4 | import { MVideo, MVideoWithAllFiles } from './video' | ||
4 | 5 | ||
5 | type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M> | 6 | type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M> |
6 | 7 | ||
@@ -11,7 +12,7 @@ export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | |||
11 | export type MVideoChangeOwnershipFull = MVideoChangeOwnership & | 12 | export type MVideoChangeOwnershipFull = MVideoChangeOwnership & |
12 | Use<'Initiator', MAccountDefault> & | 13 | Use<'Initiator', MAccountDefault> & |
13 | Use<'NextOwner', MAccountDefault> & | 14 | Use<'NextOwner', MAccountDefault> & |
14 | Use<'Video', MVideoWithFileThumbnail> | 15 | Use<'Video', MVideoWithAllFiles> |
15 | 16 | ||
16 | // ############################################################################ | 17 | // ############################################################################ |
17 | 18 | ||
diff --git a/server/typings/models/video/video-comment.ts b/server/typings/models/video/video-comment.ts index 4fd1c29e8..d693f9186 100644 --- a/server/typings/models/video/video-comment.ts +++ b/server/typings/models/video/video-comment.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { VideoCommentModel } from '../../../models/video/video-comment' | 1 | import { VideoCommentModel } from '../../../models/video/video-comment' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '../../utils' |
3 | import { MAccountDefault, MAccountFormattable, MAccountUrl, MActorUrl } from '../account' | 3 | import { MAccountDefault, MAccountFormattable, MAccountUrl } from '../account' |
4 | import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video' | 4 | import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video' |
5 | 5 | ||
6 | type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K, M> | 6 | type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K, M> |
diff --git a/server/typings/models/video/video-file.ts b/server/typings/models/video/video-file.ts index 484351a8d..352fe3d32 100644 --- a/server/typings/models/video/video-file.ts +++ b/server/typings/models/video/video-file.ts | |||
@@ -2,18 +2,33 @@ import { VideoFileModel } from '../../../models/video/video-file' | |||
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '../../utils' |
3 | import { MVideo, MVideoUUID } from './video' | 3 | import { MVideo, MVideoUUID } from './video' |
4 | import { MVideoRedundancyFileUrl } from './video-redundancy' | 4 | import { MVideoRedundancyFileUrl } from './video-redundancy' |
5 | import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist' | ||
5 | 6 | ||
6 | type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M> | 7 | type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M> |
7 | 8 | ||
8 | // ############################################################################ | 9 | // ############################################################################ |
9 | 10 | ||
10 | export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos'> | 11 | export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos' | 'VideoStreamingPlaylist'> |
11 | 12 | ||
12 | export type MVideoFileVideo = MVideoFile & | 13 | export type MVideoFileVideo = MVideoFile & |
13 | Use<'Video', MVideo> | 14 | Use<'Video', MVideo> |
14 | 15 | ||
16 | export type MVideoFileStreamingPlaylist = MVideoFile & | ||
17 | Use<'VideoStreamingPlaylist', MStreamingPlaylist> | ||
18 | |||
19 | export type MVideoFileStreamingPlaylistVideo = MVideoFile & | ||
20 | Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> | ||
21 | |||
15 | export type MVideoFileVideoUUID = MVideoFile & | 22 | export type MVideoFileVideoUUID = MVideoFile & |
16 | Use<'Video', MVideoUUID> | 23 | Use<'Video', MVideoUUID> |
17 | 24 | ||
18 | export type MVideoFileRedundanciesOpt = MVideoFile & | 25 | export type MVideoFileRedundanciesOpt = MVideoFile & |
19 | PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> | 26 | PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> |
27 | |||
28 | export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingPlaylist { | ||
29 | return !!file.videoStreamingPlaylistId | ||
30 | } | ||
31 | |||
32 | export function isWebtorrentFile (file: any): file is MVideoFileVideo { | ||
33 | return !!file.videoId | ||
34 | } | ||
diff --git a/server/typings/models/video/video-import.ts b/server/typings/models/video/video-import.ts index c6a1c5b66..e119f17f9 100644 --- a/server/typings/models/video/video-import.ts +++ b/server/typings/models/video/video-import.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { VideoImportModel } from '@server/models/video/video-import' | 1 | import { VideoImportModel } from '@server/models/video/video-import' |
2 | import { PickWith, PickWithOpt } from '@server/typings/utils' | 2 | import { PickWith, PickWithOpt } from '@server/typings/utils' |
3 | import { MUser, MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from '@server/typings/models' | 3 | import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video' |
4 | import { MUser } from '../user/user' | ||
4 | 5 | ||
5 | type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M> | 6 | type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M> |
6 | 7 | ||
diff --git a/server/typings/models/video/video-playlist-element.ts b/server/typings/models/video/video-playlist-element.ts index 7b1b993ce..1aeff78d8 100644 --- a/server/typings/models/video/video-playlist-element.ts +++ b/server/typings/models/video/video-playlist-element.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' | 1 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' |
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MVideoFormattable, MVideoPlaylistPrivacy, MVideoThumbnail, MVideoUrl } from '@server/typings/models' | 3 | import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video' |
4 | import { MVideoPlaylistPrivacy } from './video-playlist' | ||
4 | 5 | ||
5 | type Use<K extends keyof VideoPlaylistElementModel, M> = PickWith<VideoPlaylistElementModel, K, M> | 6 | type Use<K extends keyof VideoPlaylistElementModel, M> = PickWith<VideoPlaylistElementModel, K, M> |
6 | 7 | ||
diff --git a/server/typings/models/video/video-rate.ts b/server/typings/models/video/video-rate.ts index 2ff8a625b..f6bb527fc 100644 --- a/server/typings/models/video/video-rate.ts +++ b/server/typings/models/video/video-rate.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { AccountVideoRateModel } from '@server/models/account/account-video-rate' | 1 | import { AccountVideoRateModel } from '@server/models/account/account-video-rate' |
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MAccountAudience, MAccountUrl, MVideo, MVideoFormattable } from '..' | 3 | import { MAccountAudience, MAccountUrl } from '../account/account' |
4 | import { MVideo, MVideoFormattable } from './video' | ||
4 | 5 | ||
5 | type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateModel, K, M> | 6 | type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateModel, K, M> |
6 | 7 | ||
diff --git a/server/typings/models/video/video-redundancy.ts b/server/typings/models/video/video-redundancy.ts index f3846afd7..25bdac057 100644 --- a/server/typings/models/video/video-redundancy.ts +++ b/server/typings/models/video/video-redundancy.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' | 1 | import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' |
2 | import { PickWith, PickWithOpt } from '@server/typings/utils' | 2 | import { PickWith, PickWithOpt } from '@server/typings/utils' |
3 | import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo, MVideoUrl } from '@server/typings/models' | ||
4 | import { VideoStreamingPlaylist } from '../../../../shared/models/videos/video-streaming-playlist.model' | ||
5 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' | 3 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' |
6 | import { VideoFile } from '../../../../shared/models/videos' | ||
7 | import { VideoFileModel } from '@server/models/video/video-file' | 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 | 8 | ||
9 | type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M> | 9 | type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M> |
10 | 10 | ||
diff --git a/server/typings/models/video/video-streaming-playlist.ts b/server/typings/models/video/video-streaming-playlist.ts index 79696bcff..436c0c072 100644 --- a/server/typings/models/video/video-streaming-playlist.ts +++ b/server/typings/models/video/video-streaming-playlist.ts | |||
@@ -1,19 +1,33 @@ | |||
1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' | 1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '../../utils' |
3 | import { MVideoRedundancyFileUrl } from './video-redundancy' | 3 | import { MVideoRedundancyFileUrl } from './video-redundancy' |
4 | import { MVideo, MVideoUrl } from '@server/typings/models' | 4 | import { MVideo } from './video' |
5 | import { MVideoFile } from './video-file' | ||
5 | 6 | ||
6 | type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M> | 7 | type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M> |
7 | 8 | ||
8 | // ############################################################################ | 9 | // ############################################################################ |
9 | 10 | ||
10 | export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos'> | 11 | export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'> |
12 | |||
13 | export type MStreamingPlaylistFiles = MStreamingPlaylist & | ||
14 | Use<'VideoFiles', MVideoFile[]> | ||
11 | 15 | ||
12 | export type MStreamingPlaylistVideo = MStreamingPlaylist & | 16 | export type MStreamingPlaylistVideo = MStreamingPlaylist & |
13 | Use<'Video', MVideo> | 17 | Use<'Video', MVideo> |
14 | 18 | ||
19 | export type MStreamingPlaylistFilesVideo = MStreamingPlaylist & | ||
20 | Use<'VideoFiles', MVideoFile[]> & | ||
21 | Use<'Video', MVideo> | ||
22 | |||
15 | export type MStreamingPlaylistRedundancies = MStreamingPlaylist & | 23 | export type MStreamingPlaylistRedundancies = MStreamingPlaylist & |
24 | Use<'VideoFiles', MVideoFile[]> & | ||
16 | Use<'RedundancyVideos', MVideoRedundancyFileUrl[]> | 25 | Use<'RedundancyVideos', MVideoRedundancyFileUrl[]> |
17 | 26 | ||
18 | export type MStreamingPlaylistRedundanciesOpt = MStreamingPlaylist & | 27 | export type MStreamingPlaylistRedundanciesOpt = MStreamingPlaylist & |
28 | Use<'VideoFiles', MVideoFile[]> & | ||
19 | PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> | 29 | PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> |
30 | |||
31 | export function isStreamingPlaylist (value: MVideo | MStreamingPlaylistVideo): value is MStreamingPlaylistVideo { | ||
32 | return !!(value as MStreamingPlaylist).playlistUrl | ||
33 | } | ||
diff --git a/server/typings/models/video/video.ts b/server/typings/models/video/video.ts index 9a53bd337..7f69a91de 100644 --- a/server/typings/models/video/video.ts +++ b/server/typings/models/video/video.ts | |||
@@ -10,7 +10,7 @@ import { | |||
10 | } from './video-channels' | 10 | } from './video-channels' |
11 | import { MTag } from './tag' | 11 | import { MTag } from './tag' |
12 | import { MVideoCaptionLanguage } from './video-caption' | 12 | import { MVideoCaptionLanguage } from './video-caption' |
13 | import { MStreamingPlaylist, MStreamingPlaylistRedundancies, MStreamingPlaylistRedundanciesOpt } from './video-streaming-playlist' | 13 | import { MStreamingPlaylistFiles, MStreamingPlaylistRedundancies, MStreamingPlaylistRedundanciesOpt } from './video-streaming-playlist' |
14 | import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file' | 14 | import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file' |
15 | import { MThumbnail } from './thumbnail' | 15 | import { MThumbnail } from './thumbnail' |
16 | import { MVideoBlacklist, MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' | 16 | import { MVideoBlacklist, MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' |
@@ -40,7 +40,8 @@ export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'> | |||
40 | 40 | ||
41 | // "With" to not confuse with the VideoFile model | 41 | // "With" to not confuse with the VideoFile model |
42 | export type MVideoWithFile = MVideo & | 42 | export type MVideoWithFile = MVideo & |
43 | Use<'VideoFiles', MVideoFile[]> | 43 | Use<'VideoFiles', MVideoFile[]> & |
44 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> | ||
44 | 45 | ||
45 | export type MVideoThumbnail = MVideo & | 46 | export type MVideoThumbnail = MVideo & |
46 | Use<'Thumbnails', MThumbnail[]> | 47 | Use<'Thumbnails', MThumbnail[]> |
@@ -66,7 +67,7 @@ export type MVideoWithCaptions = MVideo & | |||
66 | Use<'VideoCaptions', MVideoCaptionLanguage[]> | 67 | Use<'VideoCaptions', MVideoCaptionLanguage[]> |
67 | 68 | ||
68 | export type MVideoWithStreamingPlaylist = MVideo & | 69 | export type MVideoWithStreamingPlaylist = MVideo & |
69 | Use<'VideoStreamingPlaylists', MStreamingPlaylist[]> | 70 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> |
70 | 71 | ||
71 | // ############################################################################ | 72 | // ############################################################################ |
72 | 73 | ||
@@ -93,12 +94,12 @@ export type MVideoWithRights = MVideo & | |||
93 | export type MVideoWithAllFiles = MVideo & | 94 | export type MVideoWithAllFiles = MVideo & |
94 | Use<'VideoFiles', MVideoFile[]> & | 95 | Use<'VideoFiles', MVideoFile[]> & |
95 | Use<'Thumbnails', MThumbnail[]> & | 96 | Use<'Thumbnails', MThumbnail[]> & |
96 | Use<'VideoStreamingPlaylists', MStreamingPlaylist[]> | 97 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> |
97 | 98 | ||
98 | export type MVideoAccountLightBlacklistAllFiles = MVideo & | 99 | export type MVideoAccountLightBlacklistAllFiles = MVideo & |
99 | Use<'VideoFiles', MVideoFile[]> & | 100 | Use<'VideoFiles', MVideoFile[]> & |
100 | Use<'Thumbnails', MThumbnail[]> & | 101 | Use<'Thumbnails', MThumbnail[]> & |
101 | Use<'VideoStreamingPlaylists', MStreamingPlaylist[]> & | 102 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & |
102 | Use<'VideoChannel', MChannelAccountLight> & | 103 | Use<'VideoChannel', MChannelAccountLight> & |
103 | Use<'VideoBlacklist', MVideoBlacklistLight> | 104 | Use<'VideoBlacklist', MVideoBlacklistLight> |
104 | 105 | ||
@@ -124,7 +125,7 @@ export type MVideoFullLight = MVideo & | |||
124 | Use<'UserVideoHistories', MUserVideoHistoryTime[]> & | 125 | Use<'UserVideoHistories', MUserVideoHistoryTime[]> & |
125 | Use<'VideoFiles', MVideoFile[]> & | 126 | Use<'VideoFiles', MVideoFile[]> & |
126 | Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & | 127 | Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & |
127 | Use<'VideoStreamingPlaylists', MStreamingPlaylist[]> | 128 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> |
128 | 129 | ||
129 | // ############################################################################ | 130 | // ############################################################################ |
130 | 131 | ||
@@ -133,10 +134,11 @@ export type MVideoFullLight = MVideo & | |||
133 | export type MVideoAP = MVideo & | 134 | export type MVideoAP = MVideo & |
134 | Use<'Tags', MTag[]> & | 135 | Use<'Tags', MTag[]> & |
135 | Use<'VideoChannel', MChannelAccountLight> & | 136 | Use<'VideoChannel', MChannelAccountLight> & |
136 | Use<'VideoStreamingPlaylists', MStreamingPlaylist[]> & | 137 | Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & |
137 | Use<'VideoCaptions', MVideoCaptionLanguage[]> & | 138 | Use<'VideoCaptions', MVideoCaptionLanguage[]> & |
138 | Use<'VideoBlacklist', MVideoBlacklistUnfederated> & | 139 | Use<'VideoBlacklist', MVideoBlacklistUnfederated> & |
139 | Use<'VideoFiles', MVideoFileRedundanciesOpt[]> | 140 | Use<'VideoFiles', MVideoFileRedundanciesOpt[]> & |
141 | Use<'Thumbnails', MThumbnail[]> | ||
140 | 142 | ||
141 | export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'> | 143 | export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'> |
142 | 144 | ||