aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-06 17:19:53 +0200
committerChocobozzz <me@florianbigard.com>2019-08-06 17:26:51 +0200
commit6b9c966f6428c9e47bead3410a0401e8ebd744bf (patch)
tree282218ec56725b0e2e878b0471cd08a54fd91998 /shared/extra-utils
parent466e3f20a537f1eff4b4fd03297df11ba371d049 (diff)
downloadPeerTube-6b9c966f6428c9e47bead3410a0401e8ebd744bf.tar.gz
PeerTube-6b9c966f6428c9e47bead3410a0401e8ebd744bf.tar.zst
PeerTube-6b9c966f6428c9e47bead3410a0401e8ebd744bf.zip
Automatically remove bad followings
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/miscs/sql.ts9
1 files changed, 9 insertions, 0 deletions
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
80 return seq.query(`UPDATE "plugin" SET "version" = '${newVersion}' WHERE "name" = '${pluginName}'`, options) 80 return seq.query(`UPDATE "plugin" SET "version" = '${newVersion}' WHERE "name" = '${pluginName}'`, options)
81} 81}
82 82
83function setActorFollowScores (internalServerNumber: number, newScore: number) {
84 const seq = getSequelize(internalServerNumber)
85
86 const options = { type: QueryTypes.UPDATE }
87
88 return seq.query(`UPDATE "actorFollow" SET "score" = ${newScore}`, options)
89}
90
83export { 91export {
84 setVideoField, 92 setVideoField,
85 setPlaylistField, 93 setPlaylistField,
86 setActorField, 94 setActorField,
87 countVideoViewsOf, 95 countVideoViewsOf,
88 setPluginVersion, 96 setPluginVersion,
97 setActorFollowScores,
89 closeAllSequelize 98 closeAllSequelize
90} 99}