aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/avatar.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-08 10:37:08 +0200
committerChocobozzz <me@florianbigard.com>2018-10-08 10:37:08 +0200
commit505319061e28da647c2e9af6e65721d6b8f9da1b (patch)
treeafc843e766d680e111f1e96c3b377ded4da39945 /server/lib/avatar.ts
parent4232d092bbba9a0bc0dfb0e82322829970c49454 (diff)
downloadPeerTube-505319061e28da647c2e9af6e65721d6b8f9da1b.tar.gz
PeerTube-505319061e28da647c2e9af6e65721d6b8f9da1b.tar.zst
PeerTube-505319061e28da647c2e9af6e65721d6b8f9da1b.zip
Fix avatar update
Diffstat (limited to 'server/lib/avatar.ts')
-rw-r--r--server/lib/avatar.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/lib/avatar.ts b/server/lib/avatar.ts
index 4b6bc3185..021426a1a 100644
--- a/server/lib/avatar.ts
+++ b/server/lib/avatar.ts
@@ -7,10 +7,11 @@ import { AccountModel } from '../models/account/account'
7import { VideoChannelModel } from '../models/video/video-channel' 7import { VideoChannelModel } from '../models/video/video-channel'
8import { extname, join } from 'path' 8import { extname, join } from 'path'
9import { retryTransactionWrapper } from '../helpers/database-utils' 9import { retryTransactionWrapper } from '../helpers/database-utils'
10import * as uuidv4 from 'uuid/v4'
10 11
11async function updateActorAvatarFile (avatarPhysicalFile: Express.Multer.File, accountOrChannel: AccountModel | VideoChannelModel) { 12async function updateActorAvatarFile (avatarPhysicalFile: Express.Multer.File, accountOrChannel: AccountModel | VideoChannelModel) {
12 const extension = extname(avatarPhysicalFile.filename) 13 const extension = extname(avatarPhysicalFile.filename)
13 const avatarName = accountOrChannel.Actor.uuid + extension 14 const avatarName = uuidv4() + extension
14 const destination = join(CONFIG.STORAGE.AVATARS_DIR, avatarName) 15 const destination = join(CONFIG.STORAGE.AVATARS_DIR, avatarName)
15 await processImage(avatarPhysicalFile, destination, AVATARS_SIZE) 16 await processImage(avatarPhysicalFile, destination, AVATARS_SIZE)
16 17