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({
// 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: {