import { UserVideoRateUpdate } from '../../../../shared'
import { logger } from '../../../helpers/logger'
import { VIDEO_RATE_TYPES } from '../../../initializers/constants'
-import { getRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates'
+import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates'
import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares'
import { AccountModel } from '../../../models/account/account'
import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
await previousRate.destroy(sequelizeOptions)
} else { // Update previous rate
previousRate.type = rateType
- previousRate.url = getRateUrl(rateType, userAccount.Actor, videoInstance)
+ previousRate.url = getLocalRateUrl(rateType, userAccount.Actor, videoInstance)
await previousRate.save(sequelizeOptions)
}
} else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate
accountId: accountInstance.id,
videoId: videoInstance.id,
type: rateType,
- url: getRateUrl(rateType, userAccount.Actor, videoInstance)
+ url: getLocalRateUrl(rateType, userAccount.Actor, videoInstance)
}
await AccountVideoRateModel.create(query, sequelizeOptions)