]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/video/video-details.model.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / video / video-details.model.ts
index a1cb051e927d4654e0f61cf85f59a4ccf50b7a26..45c053507a0685519d6163db2ae3e2e5666fb9d6 100644 (file)
@@ -15,7 +15,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
   support: string
   channel: VideoChannel
   tags: string[]
-  files: VideoFile[]
   account: Account
   commentsEnabled: boolean
   downloadEnabled: boolean
@@ -28,13 +27,13 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
 
   trackerUrls: string[]
 
+  files: VideoFile[]
   streamingPlaylists: VideoStreamingPlaylist[]
 
   constructor (hash: VideoDetailsServerModel, translations = {}) {
     super(hash, translations)
 
     this.descriptionPath = hash.descriptionPath
-    this.files = hash.files
     this.channel = new VideoChannel(hash.channel)
     this.account = new Account(hash.account)
     this.tags = hash.tags
@@ -43,7 +42,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
     this.downloadEnabled = hash.downloadEnabled
 
     this.trackerUrls = hash.trackerUrls
-    this.streamingPlaylists = hash.streamingPlaylists
 
     this.buildLikeAndDislikePercents()
   }
@@ -62,8 +60,11 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
   }
 
   getFiles () {
-    if (this.files.length === 0) return this.getHlsPlaylist().files
+    if (this.files.length !== 0) return this.files
+
+    const hls = this.getHlsPlaylist()
+    if (hls) return hls.files
 
-    return this.files
+    return []
   }
 }