diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-08 10:35:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-08 13:38:04 +0200 |
commit | a0eeb45f14bab539f505861cad8f5d42d9ba30cb (patch) | |
tree | 773eb5aa575c8ab870b9c84f686e6062aa58d9fd /server/models/account/actor-image.ts | |
parent | ca873292899c9a822a236556993916d98da14913 (diff) | |
download | PeerTube-a0eeb45f14bab539f505861cad8f5d42d9ba30cb.tar.gz PeerTube-a0eeb45f14bab539f505861cad8f5d42d9ba30cb.tar.zst PeerTube-a0eeb45f14bab539f505861cad8f5d42d9ba30cb.zip |
Update data in DB when regenerate thumbnails
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: { |