aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-12-06 18:04:40 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-12-06 18:04:40 +0100
commit6a9e1d42f878c55ac5e2af8a1c98e6fe28a04f36 (patch)
tree3485a0d7fa8858dc42d9d5fdf37784144c62e651 /client/src/app/shared
parentb1fa3eba70dbd7d9e5b795ad251e293c88ebeee2 (diff)
downloadPeerTube-6a9e1d42f878c55ac5e2af8a1c98e6fe28a04f36.tar.gz
PeerTube-6a9e1d42f878c55ac5e2af8a1c98e6fe28a04f36.tar.zst
PeerTube-6a9e1d42f878c55ac5e2af8a1c98e6fe28a04f36.zip
Add likes/dislikes bar
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/video/video-details.model.ts5
1 files changed, 5 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 1a956da7c..b96f8f6c8 100644
--- a/client/src/app/shared/video/video-details.model.ts
+++ b/client/src/app/shared/video/video-details.model.ts
@@ -46,6 +46,8 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
46 privacy: VideoPrivacy 46 privacy: VideoPrivacy
47 privacyLabel: string 47 privacyLabel: string
48 account: Account 48 account: Account
49 likesPercent: number
50 dislikesPercent: number
49 51
50 constructor (hash: VideoDetailsServerModel) { 52 constructor (hash: VideoDetailsServerModel) {
51 super(hash) 53 super(hash)
@@ -56,6 +58,9 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
56 this.files = hash.files 58 this.files = hash.files
57 this.channel = hash.channel 59 this.channel = hash.channel
58 this.account = hash.account 60 this.account = hash.account
61
62 this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100
63 this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100
59 } 64 }
60 65
61 getAppropriateMagnetUri (actualDownloadSpeed = 0) { 66 getAppropriateMagnetUri (actualDownloadSpeed = 0) {