- // Like
- if (likes > 0) await sendLikeToVideoFollowers(actor, video, t)
- // Dislike
- if (dislikes > 0) await sendCreateDislikeToVideoFollowers(actor, video, t)
+ if (created) rateCounts += 1
+ } catch (err) {
+ logger.warn('Cannot add rate %s for actor %s.', rate, actorUrl, { err })
+ }
+ }, { concurrency: CRAWL_REQUEST_CONCURRENCY })
+
+ logger.info('Adding %d %s to video %s.', rateCounts, rate, video.uuid)
+
+ // This is "likes" and "dislikes"
+ if (rateCounts !== 0) await video.increment(rate + 's', { by: rateCounts })
+
+ return