]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/videos/video.model.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / shared / models / videos / video.model.ts
index 6a096195f1865a3ec07f0818494afdad8dfbdae1..a69152759aa0e77d43de607bf0a81ed02b2f1d48 100644 (file)
@@ -1,29 +1,23 @@
+import { AccountSummary, VideoChannelSummary, 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: number
-  label: string
-}
-
-export interface VideoFile {
-  magnetUri: string
-  resolution: VideoConstant<number>
-  size: number // Bytes
-  torrentUrl: string
-  fileUrl: string
-}
+import { VideoScheduleUpdate } from './video-schedule-update.model'
+import { VideoConstant } from './video-constant.model'
+import { VideoStreamingPlaylist } from './video-streaming-playlist.model'
+import { VideoFile } from './video-file.model'
 
 export interface Video {
   id: number
   uuid: string
   createdAt: Date | string
   updatedAt: Date | string
+  publishedAt: Date | string
+  originallyPublishedAt: Date | string
   category: VideoConstant<number>
   licence: VideoConstant<number>
-  language: VideoConstant<number>
+  language: VideoConstant<string>
+  privacy: VideoConstant<VideoPrivacy>
   description: string
   duration: number
   isLocal: boolean
@@ -36,22 +30,36 @@ export interface Video {
   dislikes: number
   nsfw: boolean
 
-  account: {
-    name: string
-    displayName: string
-    url: string
-    host: string
-    avatar: Avatar
+  waitTranscoding?: boolean
+  state?: VideoConstant<VideoState>
+  scheduledUpdate?: VideoScheduleUpdate
+
+  blacklisted?: boolean
+  blacklistedReason?: string
+
+  account: AccountSummary
+  channel: VideoChannelSummary
+
+  userHistory?: {
+    currentTime: number
   }
 }
 
 export interface VideoDetails extends Video {
-  privacy: VideoConstant<VideoPrivacy>
   descriptionPath: string
   support: string
   channel: VideoChannel
+  account: Account
   tags: string[]
   files: VideoFile[]
-  account: Account
   commentsEnabled: boolean
+  downloadEnabled: boolean
+
+  // Not optional in details (unlike in Video)
+  waitTranscoding: boolean
+  state: VideoConstant<VideoState>
+
+  trackerUrls: string[]
+
+  streamingPlaylists: VideoStreamingPlaylist[]
 }