]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/videos/video.model.ts
Merge branch 'release/v1.2.0'
[github/Chocobozzz/PeerTube.git] / shared / models / videos / video.model.ts
index 1c86545d39982c07f8717c48db0ce980aa1a5037..022876a0bffe83c66af02018fbc8c2e84378f83c 100644 (file)
@@ -1,13 +1,10 @@
-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 { VideoChannel } from './channel/video-channel.model'
 import { VideoPrivacy } from './video-privacy.enum'
-
-export interface VideoConstant <T> {
-  id: T
-  label: string
-}
+import { VideoScheduleUpdate } from './video-schedule-update.model'
+import { VideoConstant } from './video-constant.model'
 
 export interface VideoFile {
   magnetUri: string
@@ -17,6 +14,27 @@ export interface VideoFile {
   torrentDownloadUrl: string
   fileUrl: string
   fileDownloadUrl: string
+  fps: number
+}
+
+export interface VideoChannelAttribute {
+  id: number
+  uuid: string
+  name: string
+  displayName: string
+  url: string
+  host: string
+  avatar?: Avatar
+}
+
+export interface AccountAttribute {
+  id: number
+  uuid: string
+  name: string
+  displayName: string
+  url: string
+  host: string
+  avatar?: Avatar
 }
 
 export interface Video {
@@ -41,24 +59,18 @@ export interface Video {
   dislikes: number
   nsfw: boolean
 
-  account: {
-    id: number
-    uuid: string
-    name: string
-    displayName: string
-    url: string
-    host: string
-    avatar: Avatar
-  }
+  waitTranscoding?: boolean
+  state?: VideoConstant<VideoState>
+  scheduledUpdate?: VideoScheduleUpdate
+
+  blacklisted?: boolean
+  blacklistedReason?: string
 
-  channel: {
-    id: number
-    uuid: string
-    name: string
-    displayName: string
-    url: string
-    host: string
-    avatar: Avatar
+  account: AccountAttribute
+  channel: VideoChannelAttribute
+
+  userHistory?: {
+    currentTime: number
   }
 }
 
@@ -70,4 +82,8 @@ export interface VideoDetails extends Video {
   files: VideoFile[]
   account: Account
   commentsEnabled: boolean
+
+  // Not optional in details (unlike in Video)
+  waitTranscoding: boolean
+  state: VideoConstant<VideoState>
 }