diff options
Diffstat (limited to 'server/models/account/actor-image.ts')
-rw-r--r-- | server/models/account/actor-image.ts | 5 |
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 @@ | |||
1 | import { remove } from 'fs-extra' | 1 | import { remove } from 'fs-extra' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { AfterDestroy, AllowNull, Column, CreatedAt, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' | 3 | import { AfterDestroy, AllowNull, Column, CreatedAt, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' |
4 | import { v4 as uuidv4 } from 'uuid' | ||
4 | import { MActorImageFormattable } from '@server/types/models' | 5 | import { MActorImageFormattable } from '@server/types/models' |
5 | import { ActorImageType } from '@shared/models' | 6 | import { ActorImageType } from '@shared/models' |
6 | import { ActorImage } from '../../../shared/models/actors/actor-image.model' | 7 | import { 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: { |