X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fmiscs%2Fsql.ts;h=65a0aa5fe648eef94a3476df945f8e940049d965;hb=3ce48a0cd062d9ff64d9411d702453503a49f3b1;hp=35e493456691c695b706a04efacfed33dd48ea10;hpb=e62f03ae0412f4efa62917d8741bc1a39e8ed7fc;p=github%2FChocobozzz%2FPeerTube.git 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) { return parseInt(total + '', 10) } +function getActorImage (internalServerNumber: number, filename: string) { + return selectQuery(internalServerNumber, `SELECT * FROM "actorImage" WHERE filename = '${filename}'`) + .then(rows => rows[0]) +} + function selectQuery (internalServerNumber: number, query: string) { const seq = getSequelize(internalServerNumber) const options = { type: QueryTypes.SELECT as QueryTypes.SELECT } @@ -146,6 +151,7 @@ export { setPluginVersion, setPluginLatestVersion, selectQuery, + getActorImage, deleteAll, setTokenField, updateQuery,