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.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,