diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-11 18:35:39 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-11 18:35:39 +0100 |
commit | 05bc4dfa069be5273765a68652598d72dbf482fb (patch) | |
tree | 2d86a907390f42a1ae9befd1dd69ff4f7b6ede0a /server | |
parent | 4bbc373f134ecbf53f0198277663a25b26a19cc8 (diff) | |
download | PeerTube-05bc4dfa069be5273765a68652598d72dbf482fb.tar.gz PeerTube-05bc4dfa069be5273765a68652598d72dbf482fb.tar.zst PeerTube-05bc4dfa069be5273765a68652598d72dbf482fb.zip |
Add maximum to actor follow scores
Diffstat (limited to 'server')
-rw-r--r-- | server/models/activitypub/actor-follow.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index 78a65a0ff..920c83d88 100644 --- a/server/models/activitypub/actor-follow.ts +++ b/server/models/activitypub/actor-follow.ts | |||
@@ -307,7 +307,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> { | |||
307 | private static incrementScores (inboxUrls: string[], value: number, t: Sequelize.Transaction) { | 307 | private static incrementScores (inboxUrls: string[], value: number, t: Sequelize.Transaction) { |
308 | const inboxUrlsString = inboxUrls.map(url => `'${url}'`).join(',') | 308 | const inboxUrlsString = inboxUrls.map(url => `'${url}'`).join(',') |
309 | 309 | ||
310 | const query = 'UPDATE "actorFollow" SET "score" = "score" +' + value + ' ' + | 310 | const query = `UPDATE "actorFollow" SET "score" = LEAST("score" + ${value}, ${ACTOR_FOLLOW_SCORE.MAX}) ` + |
311 | 'WHERE id IN (' + | 311 | 'WHERE id IN (' + |
312 | 'SELECT "actorFollow"."id" FROM "actorFollow" ' + | 312 | 'SELECT "actorFollow"."id" FROM "actorFollow" ' + |
313 | 'INNER JOIN "actor" ON "actor"."id" = "actorFollow"."actorId" ' + | 313 | 'INNER JOIN "actor" ON "actor"."id" = "actorFollow"."actorId" ' + |