diff options
author | Chocobozzz <me@florianbigard.com> | 2019-02-11 14:09:23 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-02-11 14:09:23 +0100 |
commit | b718fd22374d64534bcfe69932cf562894abed6a (patch) | |
tree | 311d3c67e2a4d1f33ebdd1dc163527de9d33d0f7 /client/src/app/shared/video/video-details.model.ts | |
parent | adb115f5522bea4d52456a9fc5eb4140bb064476 (diff) | |
parent | 501e961199578129629cf0567033d13efced9904 (diff) | |
download | PeerTube-b718fd22374d64534bcfe69932cf562894abed6a.tar.gz PeerTube-b718fd22374d64534bcfe69932cf562894abed6a.tar.zst PeerTube-b718fd22374d64534bcfe69932cf562894abed6a.zip |
Merge branch 'develop' into pr/1285
Diffstat (limited to 'client/src/app/shared/video/video-details.model.ts')
-rw-r--r-- | client/src/app/shared/video/video-details.model.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index fa4ca7f93..388357343 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts | |||
@@ -3,6 +3,8 @@ import { AuthUser } from '../../core' | |||
3 | import { Video } from '../../shared/video/video.model' | 3 | import { Video } from '../../shared/video/video.model' |
4 | import { Account } from '@app/shared/account/account.model' | 4 | import { Account } from '@app/shared/account/account.model' |
5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
6 | import { VideoStreamingPlaylist } from '../../../../../shared/models/videos/video-streaming-playlist.model' | ||
7 | import { VideoStreamingPlaylistType } from '../../../../../shared/models/videos/video-streaming-playlist.type' | ||
6 | 8 | ||
7 | export class VideoDetails extends Video implements VideoDetailsServerModel { | 9 | export class VideoDetails extends Video implements VideoDetailsServerModel { |
8 | descriptionPath: string | 10 | descriptionPath: string |
@@ -12,6 +14,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
12 | files: VideoFile[] | 14 | files: VideoFile[] |
13 | account: Account | 15 | account: Account |
14 | commentsEnabled: boolean | 16 | commentsEnabled: boolean |
17 | downloadEnabled: boolean | ||
15 | 18 | ||
16 | waitTranscoding: boolean | 19 | waitTranscoding: boolean |
17 | state: VideoConstant<VideoState> | 20 | state: VideoConstant<VideoState> |
@@ -19,6 +22,10 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
19 | likesPercent: number | 22 | likesPercent: number |
20 | dislikesPercent: number | 23 | dislikesPercent: number |
21 | 24 | ||
25 | trackerUrls: string[] | ||
26 | |||
27 | streamingPlaylists: VideoStreamingPlaylist[] | ||
28 | |||
22 | constructor (hash: VideoDetailsServerModel, translations = {}) { | 29 | constructor (hash: VideoDetailsServerModel, translations = {}) { |
23 | super(hash, translations) | 30 | super(hash, translations) |
24 | 31 | ||
@@ -29,6 +36,10 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
29 | this.tags = hash.tags | 36 | this.tags = hash.tags |
30 | this.support = hash.support | 37 | this.support = hash.support |
31 | this.commentsEnabled = hash.commentsEnabled | 38 | this.commentsEnabled = hash.commentsEnabled |
39 | this.downloadEnabled = hash.downloadEnabled | ||
40 | |||
41 | this.trackerUrls = hash.trackerUrls | ||
42 | this.streamingPlaylists = hash.streamingPlaylists | ||
32 | 43 | ||
33 | this.buildLikeAndDislikePercents() | 44 | this.buildLikeAndDislikePercents() |
34 | } | 45 | } |
@@ -53,4 +64,8 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
53 | this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 | 64 | this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 |
54 | this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100 | 65 | this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100 |
55 | } | 66 | } |
67 | |||
68 | getHlsPlaylist () { | ||
69 | return this.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) | ||
70 | } | ||
56 | } | 71 | } |