]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/actor/actor-image.ts
Support studio transcoding in peertube runner
[github/Chocobozzz/PeerTube.git] / server / models / actor / actor-image.ts
index 9d44ef4d1a2fdbad8f7a6b5f5634feb661e188f9..9c34a0101acf46c778f548933f7ed924d756d5a0 100644 (file)
@@ -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({
@@ -91,9 +91,21 @@ export class ActorImageModel extends Model<Partial<AttributesOnly<ActorImageMode
 
     // Don't block the transaction
     instance.removeImage()
-      .catch(err => logger.error('Cannot remove actor image file %s.', instance.filename, err))
+      .catch(err => 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: {