Add concept of video state, and add ability to wait transcoding before

publishing a video
This commit is contained in:
Chocobozzz
2018-06-12 20:04:58 +02:00
parent 6ccdf3a23e
commit 2186386cca
54 changed files with 762 additions and 476 deletions

View File

@@ -5,6 +5,7 @@ import {
ActivityUrlObject
} from './common-objects'
import { ActivityPubOrderedCollection } from '../activitypub-ordered-collection'
import { VideoState } from '../../videos'
export interface VideoTorrentObject {
type: 'Video'
@@ -19,6 +20,8 @@ export interface VideoTorrentObject {
views: number
sensitive: boolean
commentsEnabled: boolean
waitTranscoding: boolean
state: VideoState
published: string
updated: string
mediaType: 'text/markdown'

View File

@@ -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'

View File

@@ -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

View File

@@ -0,0 +1,4 @@
export enum VideoState {
PUBLISHED = 1,
TO_TRANSCODE = 2
}

View File

@@ -11,6 +11,7 @@ export interface VideoUpdate {
tags?: string[]
commentsEnabled?: boolean
nsfw?: boolean
waitTranscoding?: boolean
channelId?: number
thumbnailfile?: Blob
previewfile?: Blob

View File

@@ -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<VideoState>
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<VideoState>
}