aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/miscs/sql.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-08 11:23:45 +0200
committerChocobozzz <me@florianbigard.com>2021-04-08 13:38:04 +0200
commit84531547bc0934a2abda586d539f7455b455d488 (patch)
tree128bf5f3a7f57e4e2f343d5da574a4e002163736 /shared/extra-utils/miscs/sql.ts
parenta0eeb45f14bab539f505861cad8f5d42d9ba30cb (diff)
downloadPeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.gz
PeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.zst
PeerTube-84531547bc0934a2abda586d539f7455b455d488.zip
Add size info in db for actor images
Diffstat (limited to 'shared/extra-utils/miscs/sql.ts')
-rw-r--r--shared/extra-utils/miscs/sql.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/shared/extra-utils/miscs/sql.ts b/shared/extra-utils/miscs/sql.ts
index 35e493456..65a0aa5fe 100644
--- a/shared/extra-utils/miscs/sql.ts
+++ b/shared/extra-utils/miscs/sql.ts
@@ -82,6 +82,11 @@ async function countVideoViewsOf (internalServerNumber: number, uuid: string) {
82 return parseInt(total + '', 10) 82 return parseInt(total + '', 10)
83} 83}
84 84
85function getActorImage (internalServerNumber: number, filename: string) {
86 return selectQuery(internalServerNumber, `SELECT * FROM "actorImage" WHERE filename = '${filename}'`)
87 .then(rows => rows[0])
88}
89
85function selectQuery (internalServerNumber: number, query: string) { 90function selectQuery (internalServerNumber: number, query: string) {
86 const seq = getSequelize(internalServerNumber) 91 const seq = getSequelize(internalServerNumber)
87 const options = { type: QueryTypes.SELECT as QueryTypes.SELECT } 92 const options = { type: QueryTypes.SELECT as QueryTypes.SELECT }
@@ -146,6 +151,7 @@ export {
146 setPluginVersion, 151 setPluginVersion,
147 setPluginLatestVersion, 152 setPluginLatestVersion,
148 selectQuery, 153 selectQuery,
154 getActorImage,
149 deleteAll, 155 deleteAll,
150 setTokenField, 156 setTokenField,
151 updateQuery, 157 updateQuery,