From 136d7efde798d3dc0ec0dd18aac674365f7d162e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 3 Jun 2021 16:02:29 +0200 Subject: Refactor AP actors --- server/controllers/api/search.ts | 4 ++-- server/controllers/api/users/me.ts | 2 +- server/controllers/api/video-channel.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts index 0cb5674c2..ef0f4285d 100644 --- a/server/controllers/api/search.ts +++ b/server/controllers/api/search.ts @@ -15,7 +15,7 @@ import { buildNSFWFilter, isUserAbleToSearchRemoteURI } from '../../helpers/expr import { logger } from '../../helpers/logger' import { getFormattedObjects } from '../../helpers/utils' import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' -import { getOrCreateActorAndServerAndModel } from '../../lib/activitypub/actor' +import { getOrCreateAPActor } from '../../lib/activitypub/actors' import { asyncMiddleware, commonVideosFiltersValidator, @@ -145,7 +145,7 @@ async function searchVideoChannelURI (search: string, isWebfingerSearch: boolean if (isUserAbleToSearchRemoteURI(res)) { try { - const actor = await getOrCreateActorAndServerAndModel(uri, 'all', true, true) + const actor = await getOrCreateAPActor(uri, 'all', true, true) videoChannel = actor.VideoChannel } catch (err) { logger.info('Cannot search remote video channel %s.', uri, { err }) diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index 810e4295e..1f2b2f9dd 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts @@ -11,7 +11,7 @@ import { CONFIG } from '../../../initializers/config' import { MIMETYPES } from '../../../initializers/constants' import { sequelizeTypescript } from '../../../initializers/database' import { sendUpdateActor } from '../../../lib/activitypub/send' -import { deleteLocalActorImageFile, updateLocalActorImageFile } from '../../../lib/actor-image' +import { deleteLocalActorImageFile, updateLocalActorImageFile } from '../../../lib/local-actor' import { getOriginalVideoFileTotalDailyFromUser, getOriginalVideoFileTotalFromUser, sendVerifyUserEmail } from '../../../lib/user' import { asyncMiddleware, diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index 34207ea8a..03aa918d3 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts @@ -13,8 +13,8 @@ import { CONFIG } from '../../initializers/config' import { MIMETYPES } from '../../initializers/constants' import { sequelizeTypescript } from '../../initializers/database' import { sendUpdateActor } from '../../lib/activitypub/send' -import { deleteLocalActorImageFile, updateLocalActorImageFile } from '../../lib/actor-image' import { JobQueue } from '../../lib/job-queue' +import { deleteLocalActorImageFile, updateLocalActorImageFile } from '../../lib/local-actor' import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' import { asyncMiddleware, -- cgit v1.2.3