aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/account')
-rw-r--r--server/models/account/actor-image.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/models/account/actor-image.ts b/server/models/account/actor-image.ts
index b779e3cf6..f7438991a 100644
--- a/server/models/account/actor-image.ts
+++ b/server/models/account/actor-image.ts
@@ -1,6 +1,7 @@
1import { remove } from 'fs-extra' 1import { remove } from 'fs-extra'
2import { join } from 'path' 2import { join } from 'path'
3import { AfterDestroy, AllowNull, Column, CreatedAt, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' 3import { AfterDestroy, AllowNull, Column, CreatedAt, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'
4import { v4 as uuidv4 } from 'uuid'
4import { MActorImageFormattable } from '@server/types/models' 5import { MActorImageFormattable } from '@server/types/models'
5import { ActorImageType } from '@shared/models' 6import { ActorImageType } from '@shared/models'
6import { ActorImage } from '../../../shared/models/actors/actor-image.model' 7import { ActorImage } from '../../../shared/models/actors/actor-image.model'
@@ -53,6 +54,10 @@ export class ActorImageModel extends Model {
53 .catch(err => logger.error('Cannot remove actor image file %s.', instance.filename, err)) 54 .catch(err => logger.error('Cannot remove actor image file %s.', instance.filename, err))
54 } 55 }
55 56
57 static generateFilename () {
58 return uuidv4() + '.jpg'
59 }
60
56 static loadByName (filename: string) { 61 static loadByName (filename: string) {
57 const query = { 62 const query = {
58 where: { 63 where: {