From 2186386cca113506791583cb07d6ccacba7af4e0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Jun 2018 20:04:58 +0200 Subject: Add concept of video state, and add ability to wait transcoding before publishing a video --- shared/models/videos/index.ts | 1 + shared/models/videos/video-create.model.ts | 3 ++- shared/models/videos/video-state.enum.ts | 4 ++++ shared/models/videos/video-update.model.ts | 1 + shared/models/videos/video.model.ts | 9 ++++++++- 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 shared/models/videos/video-state.enum.ts (limited to 'shared/models/videos') 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' export * from './video-resolution.enum' export * from './video-update.model' export * from './video.model' +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 { description?: string support?: string channelId: number - nsfw: boolean + nsfw?: boolean + waitTranscoding?: boolean name: string tags?: string[] 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 @@ +export enum VideoState { + PUBLISHED = 1, + TO_TRANSCODE = 2 +} 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 { tags?: string[] commentsEnabled?: boolean nsfw?: boolean + waitTranscoding?: boolean channelId?: number thumbnailfile?: Blob 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 @@ -import { VideoResolution } from '../../index' +import { VideoResolution, VideoState } from '../../index' import { Account } from '../actors' import { Avatar } from '../avatars/avatar.model' import { VideoChannel } from './video-channel.model' @@ -41,6 +41,9 @@ export interface Video { dislikes: number nsfw: boolean + waitTranscoding?: boolean + state?: VideoConstant + account: { id: number uuid: string @@ -70,4 +73,8 @@ export interface VideoDetails extends Video { files: VideoFile[] account: Account commentsEnabled: boolean + + // Not optional in details (unlike in Video) + waitTranscoding: boolean + state: VideoConstant } -- cgit v1.2.3