aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorBenjamin Bouvier <public@benj.me>2018-01-07 14:48:10 +0100
committerChocobozzz <me@florianbigard.com>2018-01-07 14:48:10 +0100
commit57a49263e48739c31cd339730ac4cb24e3d5d723 (patch)
tree520de9caa84113e704b39ae3b6f068a4fca7a66d /server
parentcbca00dfc14fe47260e8d081f4ed0bec7c66fd09 (diff)
downloadPeerTube-57a49263e48739c31cd339730ac4cb24e3d5d723.tar.gz
PeerTube-57a49263e48739c31cd339730ac4cb24e3d5d723.tar.zst
PeerTube-57a49263e48739c31cd339730ac4cb24e3d5d723.zip
A few updates for the watch video view (#181)
* Fixes #156: Filter out the video being watched from the list of other videos of the same author; * Fixes #167: in the video view, hide the author's domain when it's from the current host; * Fixes #171: Allow undoing a like/dislike;
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/videos/rate.ts1
-rw-r--r--server/helpers/custom-validators/videos.ts2
2 files changed, 1 insertions, 2 deletions
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts
index b470f27f6..a7bd570eb 100644
--- a/server/controllers/api/videos/rate.ts
+++ b/server/controllers/api/videos/rate.ts
@@ -62,7 +62,6 @@ async function rateVideo (req: express.Request, res: express.Response) {
62 await previousRate.destroy({ transaction: t }) 62 await previousRate.destroy({ transaction: t })
63 } else { // Update previous rate 63 } else { // Update previous rate
64 previousRate.type = rateType 64 previousRate.type = rateType
65
66 await previousRate.save({ transaction: t }) 65 await previousRate.save({ transaction: t })
67 } 66 }
68 } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate 67 } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index 1a5fdb887..0e8a2aab2 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -65,7 +65,7 @@ function isVideoViewsValid (value: string) {
65} 65}
66 66
67function isVideoRatingTypeValid (value: string) { 67function isVideoRatingTypeValid (value: string) {
68 return values(VIDEO_RATE_TYPES).indexOf(value as VideoRateType) !== -1 68 return value === 'none' || values(VIDEO_RATE_TYPES).indexOf(value as VideoRateType) !== -1
69} 69}
70 70
71function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { 71function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) {