From 6b9c966f6428c9e47bead3410a0401e8ebd744bf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Aug 2019 17:19:53 +0200 Subject: Automatically remove bad followings --- shared/extra-utils/miscs/sql.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'shared/extra-utils') diff --git a/shared/extra-utils/miscs/sql.ts b/shared/extra-utils/miscs/sql.ts index dfe840d8c..167649c6d 100644 --- a/shared/extra-utils/miscs/sql.ts +++ b/shared/extra-utils/miscs/sql.ts @@ -80,11 +80,20 @@ function setPluginVersion (internalServerNumber: number, pluginName: string, new return seq.query(`UPDATE "plugin" SET "version" = '${newVersion}' WHERE "name" = '${pluginName}'`, options) } +function setActorFollowScores (internalServerNumber: number, newScore: number) { + const seq = getSequelize(internalServerNumber) + + const options = { type: QueryTypes.UPDATE } + + return seq.query(`UPDATE "actorFollow" SET "score" = ${newScore}`, options) +} + export { setVideoField, setPlaylistField, setActorField, countVideoViewsOf, setPluginVersion, + setActorFollowScores, closeAllSequelize } -- cgit v1.2.3