]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/videos/video.model.ts
Add ability to schedule video publication
[github/Chocobozzz/PeerTube.git] / shared / models / videos / video.model.ts
index 70132c050988f2b13b6e97dd00fd9a7b07f4986d..f88f381cb8d52af06f6e7d23c07867ca2af30845 100644 (file)
@@ -1,11 +1,12 @@
-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'
 import { VideoPrivacy } from './video-privacy.enum'
+import { VideoScheduleUpdate } from './video-schedule-update.model'
 
 export interface VideoConstant <T> {
-  id: number
+  id: T
   label: string
 }
 
@@ -14,7 +15,9 @@ export interface VideoFile {
   resolution: VideoConstant<VideoResolution>
   size: number // Bytes
   torrentUrl: string
+  torrentDownloadUrl: string
   fileUrl: string
+  fileDownloadUrl: string
 }
 
 export interface Video {
@@ -25,7 +28,7 @@ export interface Video {
   publishedAt: Date | string
   category: VideoConstant<number>
   licence: VideoConstant<number>
-  language: VideoConstant<number>
+  language: VideoConstant<string>
   privacy: VideoConstant<VideoPrivacy>
   description: string
   duration: number
@@ -39,7 +42,23 @@ export interface Video {
   dislikes: number
   nsfw: boolean
 
+  waitTranscoding?: boolean
+  state?: VideoConstant<VideoState>
+  scheduledUpdate?: VideoScheduleUpdate
+
   account: {
+    id: number
+    uuid: string
+    name: string
+    displayName: string
+    url: string
+    host: string
+    avatar: Avatar
+  }
+
+  channel: {
+    id: number
+    uuid: string
     name: string
     displayName: string
     url: string
@@ -56,4 +75,8 @@ export interface VideoDetails extends Video {
   files: VideoFile[]
   account: Account
   commentsEnabled: boolean
+
+  // Not optional in details (unlike in Video)
+  waitTranscoding: boolean
+  state: VideoConstant<VideoState>
 }