diff options
Diffstat (limited to 'server/lib/activitypub/process/process-create.ts')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 99841da14..559a0c23c 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -86,10 +86,14 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea | |||
86 | async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { | 86 | async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { |
87 | const view = activity.object as ViewObject | 87 | const view = activity.object as ViewObject |
88 | 88 | ||
89 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: view.object }) | 89 | const options = { |
90 | videoObject: view.object, | ||
91 | fetchType: 'only-video' as 'only-video' | ||
92 | } | ||
93 | const { video } = await getOrCreateVideoAndAccountAndChannel(options) | ||
90 | 94 | ||
91 | const actor = await ActorModel.loadByUrl(view.actor) | 95 | const actorExists = await ActorModel.isActorUrlExist(view.actor) |
92 | if (!actor) throw new Error('Unknown actor ' + view.actor) | 96 | if (actorExists === false) throw new Error('Unknown actor ' + view.actor) |
93 | 97 | ||
94 | await Redis.Instance.addVideoView(video.id) | 98 | await Redis.Instance.addVideoView(video.id) |
95 | 99 | ||