aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/actor-image.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-08 10:35:49 +0200
committerChocobozzz <me@florianbigard.com>2021-04-08 13:38:04 +0200
commita0eeb45f14bab539f505861cad8f5d42d9ba30cb (patch)
tree773eb5aa575c8ab870b9c84f686e6062aa58d9fd /server/models/account/actor-image.ts
parentca873292899c9a822a236556993916d98da14913 (diff)
downloadPeerTube-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.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: {