]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/video/video.model.ts
Add video file size info in admin videos list
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / video / video.model.ts
index b7720c8d21da3617869c159a391f2d1be60a5f6a..b11316471fe0772d3e05edcbfebfdea712c294ca 100644 (file)
@@ -10,9 +10,11 @@ import {
   UserRight,
   Video as VideoServerModel,
   VideoConstant,
+  VideoFile,
   VideoPrivacy,
   VideoScheduleUpdate,
-  VideoState
+  VideoState,
+  VideoStreamingPlaylist
 } from '@shared/models'
 
 export class Video implements VideoServerModel {
@@ -52,7 +54,7 @@ export class Video implements VideoServerModel {
   embedPath: string
   embedUrl: string
 
-  url?: string
+  url: string
 
   views: number
   likes: number
@@ -65,8 +67,12 @@ export class Video implements VideoServerModel {
   waitTranscoding?: boolean
   state?: VideoConstant<VideoState>
   scheduledUpdate?: VideoScheduleUpdate
+
   blacklisted?: boolean
-  blockedReason?: string
+  blacklistedReason?: string
+
+  blockedOwner?: boolean
+  blockedServer?: boolean
 
   account: {
     id: number
@@ -92,6 +98,9 @@ export class Video implements VideoServerModel {
 
   pluginData?: any
 
+  streamingPlaylists?: VideoStreamingPlaylist[]
+  files?: VideoFile[]
+
   static buildWatchUrl (video: Partial<Pick<Video, 'uuid' | 'shortUUID'>>) {
     return buildVideoWatchPath({ shortUUID: video.shortUUID || video.uuid })
   }
@@ -100,7 +109,7 @@ export class Video implements VideoServerModel {
     return '/videos/update/' + video.uuid
   }
 
-  constructor (hash: VideoServerModel, translations = {}) {
+  constructor (hash: VideoServerModel, translations: { [ id: string ]: string } = {}) {
     const absoluteAPIUrl = getAbsoluteAPIUrl()
 
     this.createdAt = new Date(hash.createdAt.toString())
@@ -163,7 +172,13 @@ export class Video implements VideoServerModel {
     if (this.state) this.state.label = peertubeTranslate(this.state.label, translations)
 
     this.blacklisted = hash.blacklisted
-    this.blockedReason = hash.blacklistedReason
+    this.blacklistedReason = hash.blacklistedReason
+
+    this.blockedOwner = hash.blockedOwner
+    this.blockedServer = hash.blockedServer
+
+    this.streamingPlaylists = hash.streamingPlaylists
+    this.files = hash.files
 
     this.userHistory = hash.userHistory