diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:04:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:37:51 +0200 |
commit | 2186386cca113506791583cb07d6ccacba7af4e0 (patch) | |
tree | 3c214c0b5fbd64332624267fa6e51fd4a9cf6474 /shared/models/videos | |
parent | 6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf (diff) | |
download | PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.gz PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.zst PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.zip |
Add concept of video state, and add ability to wait transcoding before
publishing a video
Diffstat (limited to 'shared/models/videos')
-rw-r--r-- | shared/models/videos/index.ts | 1 | ||||
-rw-r--r-- | shared/models/videos/video-create.model.ts | 3 | ||||
-rw-r--r-- | shared/models/videos/video-state.enum.ts | 4 | ||||
-rw-r--r-- | shared/models/videos/video-update.model.ts | 1 | ||||
-rw-r--r-- | shared/models/videos/video.model.ts | 9 |
5 files changed, 16 insertions, 2 deletions
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts index 14a10f5d8..9edfb559a 100644 --- a/shared/models/videos/index.ts +++ b/shared/models/videos/index.ts | |||
@@ -13,3 +13,4 @@ export * from './video-rate.type' | |||
13 | export * from './video-resolution.enum' | 13 | export * from './video-resolution.enum' |
14 | export * from './video-update.model' | 14 | export * from './video-update.model' |
15 | export * from './video.model' | 15 | export * from './video.model' |
16 | export * from './video-state.enum' | ||
diff --git a/shared/models/videos/video-create.model.ts b/shared/models/videos/video-create.model.ts index 562bc1bf2..2a1f622f6 100644 --- a/shared/models/videos/video-create.model.ts +++ b/shared/models/videos/video-create.model.ts | |||
@@ -7,7 +7,8 @@ export interface VideoCreate { | |||
7 | description?: string | 7 | description?: string |
8 | support?: string | 8 | support?: string |
9 | channelId: number | 9 | channelId: number |
10 | nsfw: boolean | 10 | nsfw?: boolean |
11 | waitTranscoding?: boolean | ||
11 | name: string | 12 | name: string |
12 | tags?: string[] | 13 | tags?: string[] |
13 | commentsEnabled?: boolean | 14 | commentsEnabled?: boolean |
diff --git a/shared/models/videos/video-state.enum.ts b/shared/models/videos/video-state.enum.ts new file mode 100644 index 000000000..625aefae1 --- /dev/null +++ b/shared/models/videos/video-state.enum.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export enum VideoState { | ||
2 | PUBLISHED = 1, | ||
3 | TO_TRANSCODE = 2 | ||
4 | } | ||
diff --git a/shared/models/videos/video-update.model.ts b/shared/models/videos/video-update.model.ts index c368d8464..681b00b18 100644 --- a/shared/models/videos/video-update.model.ts +++ b/shared/models/videos/video-update.model.ts | |||
@@ -11,6 +11,7 @@ export interface VideoUpdate { | |||
11 | tags?: string[] | 11 | tags?: string[] |
12 | commentsEnabled?: boolean | 12 | commentsEnabled?: boolean |
13 | nsfw?: boolean | 13 | nsfw?: boolean |
14 | waitTranscoding?: boolean | ||
14 | channelId?: number | 15 | channelId?: number |
15 | thumbnailfile?: Blob | 16 | thumbnailfile?: Blob |
16 | previewfile?: Blob | 17 | previewfile?: Blob |
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index 1c86545d3..857ca1fd9 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { VideoResolution } from '../../index' | 1 | import { VideoResolution, VideoState } from '../../index' |
2 | import { Account } from '../actors' | 2 | import { Account } from '../actors' |
3 | import { Avatar } from '../avatars/avatar.model' | 3 | import { Avatar } from '../avatars/avatar.model' |
4 | import { VideoChannel } from './video-channel.model' | 4 | import { VideoChannel } from './video-channel.model' |
@@ -41,6 +41,9 @@ export interface Video { | |||
41 | dislikes: number | 41 | dislikes: number |
42 | nsfw: boolean | 42 | nsfw: boolean |
43 | 43 | ||
44 | waitTranscoding?: boolean | ||
45 | state?: VideoConstant<VideoState> | ||
46 | |||
44 | account: { | 47 | account: { |
45 | id: number | 48 | id: number |
46 | uuid: string | 49 | uuid: string |
@@ -70,4 +73,8 @@ export interface VideoDetails extends Video { | |||
70 | files: VideoFile[] | 73 | files: VideoFile[] |
71 | account: Account | 74 | account: Account |
72 | commentsEnabled: boolean | 75 | commentsEnabled: boolean |
76 | |||
77 | // Not optional in details (unlike in Video) | ||
78 | waitTranscoding: boolean | ||
79 | state: VideoConstant<VideoState> | ||
73 | } | 80 | } |