From d4defe07d26013a75577b30608841fe3f8334308 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Sep 2018 11:41:21 +0200 Subject: Optimize video view AP processing --- server/models/activitypub/actor.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'server/models') diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index ef8dd9f7c..69c2eca57 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts @@ -266,6 +266,18 @@ export class ActorModel extends Model { return ActorModel.unscoped().findById(id) } + static isActorUrlExist (url: string) { + const query = { + raw: true, + where: { + url + } + } + + return ActorModel.unscoped().findOne(query) + .then(a => !!a) + } + static listByFollowersUrls (followersUrls: string[], transaction?: Sequelize.Transaction) { const query = { where: { -- cgit v1.2.3