aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/request-video-qadu-scheduler.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-03-08 21:35:43 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-03-08 21:35:43 +0100
commitd38b82810638b9f664c9016fac2684454c273a77 (patch)
tree9465c367e5033675309efca4d66790c6fdd5230d /server/lib/request-video-qadu-scheduler.js
parent8f9064432122cba0f518a24ac4378357dadec589 (diff)
downloadPeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.gz
PeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.zst
PeerTube-d38b82810638b9f664c9016fac2684454c273a77.zip
Add like/dislike system for videos
Diffstat (limited to 'server/lib/request-video-qadu-scheduler.js')
-rw-r--r--server/lib/request-video-qadu-scheduler.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/lib/request-video-qadu-scheduler.js b/server/lib/request-video-qadu-scheduler.js
index ac50cfc11..a85d35160 100644
--- a/server/lib/request-video-qadu-scheduler.js
+++ b/server/lib/request-video-qadu-scheduler.js
@@ -44,14 +44,17 @@ module.exports = class RequestVideoQaduScheduler extends BaseRequestScheduler {
44 } 44 }
45 } 45 }
46 46
47 const videoData = {} 47 // Maybe another attribute was filled for this video
48 let videoData = requestsToMakeGrouped[hashKey].videos[video.id]
49 if (!videoData) videoData = {}
50
48 switch (request.type) { 51 switch (request.type) {
49 case constants.REQUEST_VIDEO_QADU_TYPES.LIKES: 52 case constants.REQUEST_VIDEO_QADU_TYPES.LIKES:
50 videoData.likes = video.likes 53 videoData.likes = video.likes
51 break 54 break
52 55
53 case constants.REQUEST_VIDEO_QADU_TYPES.DISLIKES: 56 case constants.REQUEST_VIDEO_QADU_TYPES.DISLIKES:
54 videoData.likes = video.dislikes 57 videoData.dislikes = video.dislikes
55 break 58 break
56 59
57 case constants.REQUEST_VIDEO_QADU_TYPES.VIEWS: 60 case constants.REQUEST_VIDEO_QADU_TYPES.VIEWS: