]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/videos/video.model.ts
Federate entire description
[github/Chocobozzz/PeerTube.git] / shared / models / videos / video.model.ts
index 158ee8f05f408904128f6c37d9a38d91e52451cd..06ffb327c747c5ec5deafe4da546d54426396c01 100644 (file)
@@ -1,7 +1,7 @@
 import { Account, AccountSummary } from '../actors'
 import { VideoChannel, VideoChannelSummary } from './channel/video-channel.model'
+import { VideoFile } from './file'
 import { VideoConstant } from './video-constant.model'
-import { VideoFile } from './video-file.model'
 import { VideoPrivacy } from './video-privacy.enum'
 import { VideoScheduleUpdate } from './video-schedule-update.model'
 import { VideoState } from './video-state.enum'
@@ -10,6 +10,8 @@ import { VideoStreamingPlaylist } from './video-streaming-playlist.model'
 export interface Video {
   id: number
   uuid: string
+  shortUUID: string
+
   createdAt: Date | string
   updatedAt: Date | string
   publishedAt: Date | string
@@ -18,11 +20,17 @@ export interface Video {
   licence: VideoConstant<number>
   language: VideoConstant<string>
   privacy: VideoConstant<VideoPrivacy>
+
+  // Deprecated in 5.0 in favour of truncatedDescription
   description: string
+  truncatedDescription: string
+
   duration: number
   isLocal: boolean
   name: string
 
+  isLive: boolean
+
   thumbnailPath: string
   thumbnailUrl?: string
 
@@ -32,21 +40,15 @@ export interface Video {
   embedPath: string
   embedUrl?: string
 
-  // When using the search index
-  url?: string
+  url: string
 
   views: number
+  viewers: number
+
   likes: number
   dislikes: number
   nsfw: boolean
 
-  waitTranscoding?: boolean
-  state?: VideoConstant<VideoState>
-  scheduledUpdate?: VideoScheduleUpdate
-
-  blacklisted?: boolean
-  blacklistedReason?: string
-
   account: AccountSummary
   channel: VideoChannelSummary
 
@@ -55,23 +57,39 @@ export interface Video {
   }
 
   pluginData?: any
+
+  // Additional attributes dependending on the query
+  waitTranscoding?: boolean
+  state?: VideoConstant<VideoState>
+  scheduledUpdate?: VideoScheduleUpdate
+
+  blacklisted?: boolean
+  blacklistedReason?: string
+
+  blockedOwner?: boolean
+  blockedServer?: boolean
+
+  files?: VideoFile[]
+  streamingPlaylists?: VideoStreamingPlaylist[]
 }
 
 export interface VideoDetails extends Video {
+  // Deprecated in 5.0
   descriptionPath: string
+
   support: string
   channel: VideoChannel
   account: Account
   tags: string[]
-  files: VideoFile[]
   commentsEnabled: boolean
   downloadEnabled: boolean
 
-  // Not optional in details (unlike in Video)
+  // Not optional in details (unlike in parent Video)
   waitTranscoding: boolean
   state: VideoConstant<VideoState>
 
   trackerUrls: string[]
 
+  files: VideoFile[]
   streamingPlaylists: VideoStreamingPlaylist[]
 }