diff options
author | Chocobozzz <me@florianbigard.com> | 2019-02-11 11:52:34 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-02-11 11:52:34 +0100 |
commit | 88108880bbdba473cfe36ecbebc1c3c4f972e102 (patch) | |
tree | b242efb3b4f0d7e49d88f2d1f2063b5b3b0489c0 /server/lib/avatar.ts | |
parent | 53a94c7cfa8368da4cd248d65df8346905938f0c (diff) | |
parent | 9b712a2017e4ab3cf12cd6bd58278905520159d0 (diff) | |
download | PeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.tar.gz PeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.tar.zst PeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.zip |
Merge branch 'develop' into pr/1217
Diffstat (limited to 'server/lib/avatar.ts')
-rw-r--r-- | server/lib/avatar.ts | 3 |
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' | |||
7 | import { VideoChannelModel } from '../models/video/video-channel' | 7 | import { VideoChannelModel } from '../models/video/video-channel' |
8 | import { extname, join } from 'path' | 8 | import { extname, join } from 'path' |
9 | import { retryTransactionWrapper } from '../helpers/database-utils' | 9 | import { retryTransactionWrapper } from '../helpers/database-utils' |
10 | import * as uuidv4 from 'uuid/v4' | ||
10 | 11 | ||
11 | async function updateActorAvatarFile (avatarPhysicalFile: Express.Multer.File, accountOrChannel: AccountModel | VideoChannelModel) { | 12 | async 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 | ||