aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-28 09:49:40 +0100
committerChocobozzz <me@florianbigard.com>2018-02-28 09:49:40 +0100
commit20b40b195aa89778a8b6dc22f76a2ea76ef406a8 (patch)
tree46f52f2e377bcb010d2f0f3ea83915ca0a36623d /client/src/app/shared
parentacbffe9c0f2c1761fef11d49fb3da97734b000e5 (diff)
downloadPeerTube-20b40b195aa89778a8b6dc22f76a2ea76ef406a8.tar.gz
PeerTube-20b40b195aa89778a8b6dc22f76a2ea76ef406a8.tar.zst
PeerTube-20b40b195aa89778a8b6dc22f76a2ea76ef406a8.zip
Handle user rates in real time
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/video/video-details.model.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts
index a22ed68da..1882a8165 100644
--- a/client/src/app/shared/video/video-details.model.ts
+++ b/client/src/app/shared/video/video-details.model.ts
@@ -60,8 +60,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
60 this.support = hash.support 60 this.support = hash.support
61 this.commentsEnabled = hash.commentsEnabled 61 this.commentsEnabled = hash.commentsEnabled
62 62
63 this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 63 this.buildLikeAndDislikePercents()
64 this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100
65 } 64 }
66 65
67 getAppropriateMagnetUri (actualDownloadSpeed = 0) { 66 getAppropriateMagnetUri (actualDownloadSpeed = 0) {
@@ -90,4 +89,9 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
90 isUpdatableBy (user: AuthUser) { 89 isUpdatableBy (user: AuthUser) {
91 return user && this.isLocal === true && (this.accountName === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO)) 90 return user && this.isLocal === true && (this.accountName === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO))
92 } 91 }
92
93 buildLikeAndDislikePercents () {
94 this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100
95 this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100
96 }
93} 97}