From ecf3f060ef8e40846ee41c9dcdf288065f4c461d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Oct 2018 10:37:08 +0200 Subject: Fix avatar update --- server/lib/avatar.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/lib') 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' import { VideoChannelModel } from '../models/video/video-channel' import { extname, join } from 'path' import { retryTransactionWrapper } from '../helpers/database-utils' +import * as uuidv4 from 'uuid/v4' async function updateActorAvatarFile (avatarPhysicalFile: Express.Multer.File, accountOrChannel: AccountModel | VideoChannelModel) { const extension = extname(avatarPhysicalFile.filename) - const avatarName = accountOrChannel.Actor.uuid + extension + const avatarName = uuidv4() + extension const destination = join(CONFIG.STORAGE.AVATARS_DIR, avatarName) await processImage(avatarPhysicalFile, destination, AVATARS_SIZE) -- cgit v1.2.3