import { forwardVideoRelatedActivity } from '../send/utils'
import { Redis } from '../../redis'
import { createOrUpdateCacheFile } from '../cache-file'
-import { immutableAssign } from '../../../tests/utils'
import { getVideoDislikeActivityPubUrl } from '../url'
import { VideoModel } from '../../../models/video/video'
const [ , created ] = await AccountVideoRateModel.findOrCreate({
where: rate,
- defaults: immutableAssign(rate, { url: getVideoDislikeActivityPubUrl(byActor, video) }),
+ defaults: Object.assign({}, rate, { url: getVideoDislikeActivityPubUrl(byActor, video) }),
transaction: t
})
if (created === true) await video.increment('dislikes', { transaction: t })
import { ActorModel } from '../../../models/activitypub/actor'
import { forwardVideoRelatedActivity } from '../send/utils'
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
-import { immutableAssign } from '../../../tests/utils'
-import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from '../url'
+import { getVideoLikeActivityPubUrl } from '../url'
async function processLikeActivity (activity: ActivityLike, byActor: ActorModel) {
return retryTransactionWrapper(processLikeVideo, byActor, activity)
}
const [ , created ] = await AccountVideoRateModel.findOrCreate({
where: rate,
- defaults: immutableAssign(rate, { url: getVideoLikeActivityPubUrl(byActor, video) }),
+ defaults: Object.assign({}, rate, { url: getVideoLikeActivityPubUrl(byActor, video) }),
transaction: t
})
if (created === true) await video.increment('likes', { transaction: t })