X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Factor%2Factor-image.ts;h=9c34a0101acf46c778f548933f7ed924d756d5a0;hb=5e47f6ab984a7d00782e4c7030afffa1ba480add;hp=f2b3b2f4b33672052c05658d138e101526d14768;hpb=1cc9774668827c1255e4cd0775cb781c7f73051c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/actor/actor-image.ts b/server/models/actor/actor-image.ts index f2b3b2f4b..9c34a0101 100644 --- a/server/models/actor/actor-image.ts +++ b/server/models/actor/actor-image.ts @@ -22,7 +22,7 @@ import { isActivityPubUrlValid } from '../../helpers/custom-validators/activityp import { logger } from '../../helpers/logger' import { CONFIG } from '../../initializers/config' import { LAZY_STATIC_PATHS, MIMETYPES, WEBSERVER } from '../../initializers/constants' -import { throwIfNotValid } from '../utils' +import { buildSQLAttributes, throwIfNotValid } from '../shared' import { ActorModel } from './actor' @Table({ @@ -94,6 +94,18 @@ export class ActorImageModel extends Model logger.error('Cannot remove actor image file %s.', instance.filename, { err })) } + // --------------------------------------------------------------------------- + + static getSQLAttributes (tableName: string, aliasPrefix = '') { + return buildSQLAttributes({ + model: this, + tableName, + aliasPrefix + }) + } + + // --------------------------------------------------------------------------- + static loadByName (filename: string) { const query = { where: {