From 304a84d59c3a800b7f7aef48cf55f307534c0926 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 2 Jun 2021 15:47:05 +0200 Subject: Refactor getOrCreateAPVideo --- server/lib/activitypub/process/process-like.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/lib/activitypub/process/process-like.ts') diff --git a/server/lib/activitypub/process/process-like.ts b/server/lib/activitypub/process/process-like.ts index 8688b3b47..cd4e86cbb 100644 --- a/server/lib/activitypub/process/process-like.ts +++ b/server/lib/activitypub/process/process-like.ts @@ -6,7 +6,7 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat import { APProcessorOptions } from '../../../types/activitypub-processor.model' import { MActorSignature } from '../../../types/models' import { forwardVideoRelatedActivity } from '../send/utils' -import { getOrCreateVideoAndAccountAndChannel } from '../videos' +import { getOrCreateAPVideo } from '../videos' async function processLikeActivity (options: APProcessorOptions) { const { activity, byActor } = options @@ -27,7 +27,7 @@ async function processLikeVideo (byActor: MActorSignature, activity: ActivityLik const byAccount = byActor.Account if (!byAccount) throw new Error('Cannot create like with the non account actor ' + byActor.url) - const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: videoUrl }) + const { video } = await getOrCreateAPVideo({ videoObject: videoUrl }) return sequelizeTypescript.transaction(async t => { const existingRate = await AccountVideoRateModel.loadByAccountAndVideoOrUrl(byAccount.id, video.id, activity.id, t) -- cgit v1.2.3