]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/activitypub/actor.ts
Optimize video view AP processing
[github/Chocobozzz/PeerTube.git] / server / models / activitypub / actor.ts
index ef8dd9f7cbfa8026b00affe99d8c61b9574a2d47..69c2eca57ed703598a775c2e84e7a6e5b9ed4b37 100644 (file)
@@ -266,6 +266,18 @@ export class ActorModel extends Model<ActorModel> {
     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: {