diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-03 16:02:29 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-03 16:40:32 +0200 |
commit | 136d7efde798d3dc0ec0dd18aac674365f7d162e (patch) | |
tree | 3a0e2a7a5d04dedf0d8ffda99c2787cecb838891 /server/controllers/api | |
parent | 49af5ac8c2653cb0ef23479c9d3256c5b724d49d (diff) | |
download | PeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.tar.gz PeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.tar.zst PeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.zip |
Refactor AP actors
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/search.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/users/me.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/video-channel.ts | 2 |
3 files changed, 4 insertions, 4 deletions
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 | |||
15 | import { logger } from '../../helpers/logger' | 15 | import { logger } from '../../helpers/logger' |
16 | import { getFormattedObjects } from '../../helpers/utils' | 16 | import { getFormattedObjects } from '../../helpers/utils' |
17 | import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' | 17 | import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' |
18 | import { getOrCreateActorAndServerAndModel } from '../../lib/activitypub/actor' | 18 | import { getOrCreateAPActor } from '../../lib/activitypub/actors' |
19 | import { | 19 | import { |
20 | asyncMiddleware, | 20 | asyncMiddleware, |
21 | commonVideosFiltersValidator, | 21 | commonVideosFiltersValidator, |
@@ -145,7 +145,7 @@ async function searchVideoChannelURI (search: string, isWebfingerSearch: boolean | |||
145 | 145 | ||
146 | if (isUserAbleToSearchRemoteURI(res)) { | 146 | if (isUserAbleToSearchRemoteURI(res)) { |
147 | try { | 147 | try { |
148 | const actor = await getOrCreateActorAndServerAndModel(uri, 'all', true, true) | 148 | const actor = await getOrCreateAPActor(uri, 'all', true, true) |
149 | videoChannel = actor.VideoChannel | 149 | videoChannel = actor.VideoChannel |
150 | } catch (err) { | 150 | } catch (err) { |
151 | logger.info('Cannot search remote video channel %s.', uri, { err }) | 151 | 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' | |||
11 | import { MIMETYPES } from '../../../initializers/constants' | 11 | import { MIMETYPES } from '../../../initializers/constants' |
12 | import { sequelizeTypescript } from '../../../initializers/database' | 12 | import { sequelizeTypescript } from '../../../initializers/database' |
13 | import { sendUpdateActor } from '../../../lib/activitypub/send' | 13 | import { sendUpdateActor } from '../../../lib/activitypub/send' |
14 | import { deleteLocalActorImageFile, updateLocalActorImageFile } from '../../../lib/actor-image' | 14 | import { deleteLocalActorImageFile, updateLocalActorImageFile } from '../../../lib/local-actor' |
15 | import { getOriginalVideoFileTotalDailyFromUser, getOriginalVideoFileTotalFromUser, sendVerifyUserEmail } from '../../../lib/user' | 15 | import { getOriginalVideoFileTotalDailyFromUser, getOriginalVideoFileTotalFromUser, sendVerifyUserEmail } from '../../../lib/user' |
16 | import { | 16 | import { |
17 | asyncMiddleware, | 17 | 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' | |||
13 | import { MIMETYPES } from '../../initializers/constants' | 13 | import { MIMETYPES } from '../../initializers/constants' |
14 | import { sequelizeTypescript } from '../../initializers/database' | 14 | import { sequelizeTypescript } from '../../initializers/database' |
15 | import { sendUpdateActor } from '../../lib/activitypub/send' | 15 | import { sendUpdateActor } from '../../lib/activitypub/send' |
16 | import { deleteLocalActorImageFile, updateLocalActorImageFile } from '../../lib/actor-image' | ||
17 | import { JobQueue } from '../../lib/job-queue' | 16 | import { JobQueue } from '../../lib/job-queue' |
17 | import { deleteLocalActorImageFile, updateLocalActorImageFile } from '../../lib/local-actor' | ||
18 | import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' | 18 | import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' |
19 | import { | 19 | import { |
20 | asyncMiddleware, | 20 | asyncMiddleware, |