aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/miscs/sql.ts9
-rw-r--r--shared/extra-utils/server/servers.ts1
2 files changed, 10 insertions, 0 deletions
diff --git a/shared/extra-utils/miscs/sql.ts b/shared/extra-utils/miscs/sql.ts
index 345e5bc16..35e493456 100644
--- a/shared/extra-utils/miscs/sql.ts
+++ b/shared/extra-utils/miscs/sql.ts
@@ -130,6 +130,14 @@ function setActorFollowScores (internalServerNumber: number, newScore: number) {
130 return seq.query(`UPDATE "actorFollow" SET "score" = ${newScore}`, options) 130 return seq.query(`UPDATE "actorFollow" SET "score" = ${newScore}`, options)
131} 131}
132 132
133function setTokenField (internalServerNumber: number, accessToken: string, field: string, value: string) {
134 const seq = getSequelize(internalServerNumber)
135
136 const options = { type: QueryTypes.UPDATE }
137
138 return seq.query(`UPDATE "oAuthToken" SET "${field}" = '${value}' WHERE "accessToken" = '${accessToken}'`, options)
139}
140
133export { 141export {
134 setVideoField, 142 setVideoField,
135 setPlaylistField, 143 setPlaylistField,
@@ -139,6 +147,7 @@ export {
139 setPluginLatestVersion, 147 setPluginLatestVersion,
140 selectQuery, 148 selectQuery,
141 deleteAll, 149 deleteAll,
150 setTokenField,
142 updateQuery, 151 updateQuery,
143 setActorFollowScores, 152 setActorFollowScores,
144 closeAllSequelize, 153 closeAllSequelize,
diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts
index 08d05ef36..779a3cc36 100644
--- a/shared/extra-utils/server/servers.ts
+++ b/shared/extra-utils/server/servers.ts
@@ -37,6 +37,7 @@ interface ServerInfo {
37 customConfigFile?: string 37 customConfigFile?: string
38 38
39 accessToken?: string 39 accessToken?: string
40 refreshToken?: string
40 videoChannel?: VideoChannel 41 videoChannel?: VideoChannel
41 42
42 video?: { 43 video?: {