diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-28 09:49:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-28 09:49:40 +0100 |
commit | 20b40b195aa89778a8b6dc22f76a2ea76ef406a8 (patch) | |
tree | 46f52f2e377bcb010d2f0f3ea83915ca0a36623d | |
parent | acbffe9c0f2c1761fef11d49fb3da97734b000e5 (diff) | |
download | PeerTube-20b40b195aa89778a8b6dc22f76a2ea76ef406a8.tar.gz PeerTube-20b40b195aa89778a8b6dc22f76a2ea76ef406a8.tar.zst PeerTube-20b40b195aa89778a8b6dc22f76a2ea76ef406a8.zip |
Handle user rates in real time
-rw-r--r-- | CHANGELOG.md | 18 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | client/src/app/shared/video/video-details.model.ts | 8 | ||||
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 3 |
4 files changed, 29 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d780c2396..15b5101a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -1,5 +1,23 @@ | |||
1 | # Changelog | 1 | # Changelog |
2 | 2 | ||
3 | ## v0.0.29-alpha | ||
4 | |||
5 | ### BREAKING CHANGES | ||
6 | |||
7 | * Use only 1 thread for transcoding by default | ||
8 | |||
9 | ### Features | ||
10 | |||
11 | * Add help to JS/CSS custom configuration inputs | ||
12 | * Keep ratio in video thumbnail generation | ||
13 | * Handle video in portrait mode | ||
14 | |||
15 | ### Bug fixes | ||
16 | |||
17 | * Fix complete description on some videos | ||
18 | * Fix job sorting in administration | ||
19 | |||
20 | |||
3 | ## v0.0.28-alpha | 21 | ## v0.0.28-alpha |
4 | 22 | ||
5 | ### BREAKING CHANGES | 23 | ### BREAKING CHANGES |
@@ -116,6 +116,8 @@ BitTorrent) inside the web browser, as of today. | |||
116 | - [X] Video privacy settings (public, unlisted or private) | 116 | - [X] Video privacy settings (public, unlisted or private) |
117 | - [X] Signaling a video to the admin origin PeerTube instance | 117 | - [X] Signaling a video to the admin origin PeerTube instance |
118 | - [X] Federated videos comments | 118 | - [X] Federated videos comments |
119 | - [X] Update video thumbnails | ||
120 | - [X] Support video uploader button | ||
119 | - [ ] Video imports (URL, Torrent, YouTube...) | 121 | - [ ] Video imports (URL, Torrent, YouTube...) |
120 | - [ ] Advanced search | 122 | - [ ] Advanced search |
121 | - [ ] Subtitles | 123 | - [ ] Subtitles |
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 | } |
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index c9bfa7ffb..3965bade8 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -411,6 +411,9 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
411 | 411 | ||
412 | this.video.likes += likesToIncrement | 412 | this.video.likes += likesToIncrement |
413 | this.video.dislikes += dislikesToIncrement | 413 | this.video.dislikes += dislikesToIncrement |
414 | this.video.buildLikeAndDislikePercents() | ||
415 | |||
416 | this.setVideoLikesBarTooltipText() | ||
414 | } | 417 | } |
415 | 418 | ||
416 | private updateOtherVideosDisplayed () { | 419 | private updateOtherVideosDisplayed () { |