aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/rate.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/rate.ts')
-rw-r--r--server/controllers/api/videos/rate.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts
index 3ee365289..df1eddb4f 100644
--- a/server/controllers/api/videos/rate.ts
+++ b/server/controllers/api/videos/rate.ts
@@ -2,7 +2,7 @@ import * as express from 'express'
2import { UserVideoRateUpdate } from '../../../../shared' 2import { UserVideoRateUpdate } from '../../../../shared'
3import { logger } from '../../../helpers/logger' 3import { logger } from '../../../helpers/logger'
4import { VIDEO_RATE_TYPES } from '../../../initializers/constants' 4import { VIDEO_RATE_TYPES } from '../../../initializers/constants'
5import { getRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' 5import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates'
6import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' 6import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares'
7import { AccountModel } from '../../../models/account/account' 7import { AccountModel } from '../../../models/account/account'
8import { AccountVideoRateModel } from '../../../models/account/account-video-rate' 8import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
@@ -52,7 +52,7 @@ async function rateVideo (req: express.Request, res: express.Response) {
52 await previousRate.destroy(sequelizeOptions) 52 await previousRate.destroy(sequelizeOptions)
53 } else { // Update previous rate 53 } else { // Update previous rate
54 previousRate.type = rateType 54 previousRate.type = rateType
55 previousRate.url = getRateUrl(rateType, userAccount.Actor, videoInstance) 55 previousRate.url = getLocalRateUrl(rateType, userAccount.Actor, videoInstance)
56 await previousRate.save(sequelizeOptions) 56 await previousRate.save(sequelizeOptions)
57 } 57 }
58 } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate 58 } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate
@@ -60,7 +60,7 @@ async function rateVideo (req: express.Request, res: express.Response) {
60 accountId: accountInstance.id, 60 accountId: accountInstance.id,
61 videoId: videoInstance.id, 61 videoId: videoInstance.id,
62 type: rateType, 62 type: rateType,
63 url: getRateUrl(rateType, userAccount.Actor, videoInstance) 63 url: getLocalRateUrl(rateType, userAccount.Actor, videoInstance)
64 } 64 }
65 65
66 await AccountVideoRateModel.create(query, sequelizeOptions) 66 await AccountVideoRateModel.create(query, sequelizeOptions)