diff options
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/rate.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index 8216dffd2..134284df7 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts | |||
@@ -3,6 +3,7 @@ import { UserVideoRateUpdate } from '../../../../shared' | |||
3 | import { logger, retryTransactionWrapper } from '../../../helpers' | 3 | import { logger, retryTransactionWrapper } from '../../../helpers' |
4 | import { VIDEO_RATE_TYPES } from '../../../initializers' | 4 | import { VIDEO_RATE_TYPES } from '../../../initializers' |
5 | import { database as db } from '../../../initializers/database' | 5 | import { database as db } from '../../../initializers/database' |
6 | import { sendVideoRateChangeToFollowers, sendVideoRateChangeToOrigin } from '../../../lib/activitypub/videos' | ||
6 | import { asyncMiddleware, authenticate, videoRateValidator } from '../../../middlewares' | 7 | import { asyncMiddleware, authenticate, videoRateValidator } from '../../../middlewares' |
7 | import { AccountInstance } from '../../../models/account/account-interface' | 8 | import { AccountInstance } from '../../../models/account/account-interface' |
8 | import { VideoInstance } from '../../../models/video/video-interface' | 9 | import { VideoInstance } from '../../../models/video/video-interface' |
@@ -82,10 +83,10 @@ async function rateVideo (req: express.Request, res: express.Response) { | |||
82 | // It is useful for the user to have a feedback | 83 | // It is useful for the user to have a feedback |
83 | await videoInstance.increment(incrementQuery, sequelizeOptions) | 84 | await videoInstance.increment(incrementQuery, sequelizeOptions) |
84 | 85 | ||
85 | if (videoInstance.isOwned() === false) { | 86 | if (videoInstance.isOwned()) { |
86 | // TODO: Send a event to original server | 87 | await sendVideoRateChangeToFollowers(accountInstance, videoInstance, likesToIncrement, dislikesToIncrement, t) |
87 | } else { | 88 | } else { |
88 | // TODO: Send update to followers | 89 | await sendVideoRateChangeToOrigin(accountInstance, videoInstance, likesToIncrement, dislikesToIncrement, t) |
89 | } | 90 | } |
90 | }) | 91 | }) |
91 | 92 | ||