X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fvideo%2Fvideo-details.model.ts;h=45c053507a0685519d6163db2ae3e2e5666fb9d6;hb=7137377d097a74087ed062c8071c1aa5c717c7f7;hp=a1cb051e927d4654e0f61cf85f59a4ccf50b7a26;hpb=67ed6552b831df66713bac9e672738796128d33f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-main/video/video-details.model.ts b/client/src/app/shared/shared-main/video/video-details.model.ts index a1cb051e9..45c053507 100644 --- a/client/src/app/shared/shared-main/video/video-details.model.ts +++ b/client/src/app/shared/shared-main/video/video-details.model.ts @@ -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 [] } }