diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/avatar.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/avatar.ts b/server/lib/avatar.ts index 9d59a4966..e79cd1546 100644 --- a/server/lib/avatar.ts +++ b/server/lib/avatar.ts | |||
@@ -13,11 +13,12 @@ import { queue } from 'async' | |||
13 | import { downloadImage } from '../helpers/requests' | 13 | import { downloadImage } from '../helpers/requests' |
14 | import { MAccountDefault, MChannelDefault } from '../types/models' | 14 | import { MAccountDefault, MChannelDefault } from '../types/models' |
15 | 15 | ||
16 | async function updateActorAvatarFile ( | 16 | async function updateLocalActorAvatarFile ( |
17 | accountOrChannel: MAccountDefault | MChannelDefault, | 17 | accountOrChannel: MAccountDefault | MChannelDefault, |
18 | avatarPhysicalFile: Express.Multer.File | 18 | avatarPhysicalFile: Express.Multer.File |
19 | ) { | 19 | ) { |
20 | const extension = extname(avatarPhysicalFile.filename) | 20 | const extension = extname(avatarPhysicalFile.filename) |
21 | |||
21 | const avatarName = uuidv4() + extension | 22 | const avatarName = uuidv4() + extension |
22 | const destination = join(CONFIG.STORAGE.AVATARS_DIR, avatarName) | 23 | const destination = join(CONFIG.STORAGE.AVATARS_DIR, avatarName) |
23 | await processImage(avatarPhysicalFile.path, destination, AVATARS_SIZE) | 24 | await processImage(avatarPhysicalFile.path, destination, AVATARS_SIZE) |
@@ -40,7 +41,7 @@ async function updateActorAvatarFile ( | |||
40 | }) | 41 | }) |
41 | } | 42 | } |
42 | 43 | ||
43 | async function deleteActorAvatarFile ( | 44 | async function deleteLocalActorAvatarFile ( |
44 | accountOrChannel: MAccountDefault | MChannelDefault | 45 | accountOrChannel: MAccountDefault | MChannelDefault |
45 | ) { | 46 | ) { |
46 | return retryTransactionWrapper(() => { | 47 | return retryTransactionWrapper(() => { |
@@ -78,7 +79,7 @@ const avatarPathUnsafeCache = new LRUCache<string, string>({ max: LRU_CACHE.AVAT | |||
78 | 79 | ||
79 | export { | 80 | export { |
80 | avatarPathUnsafeCache, | 81 | avatarPathUnsafeCache, |
81 | updateActorAvatarFile, | 82 | updateLocalActorAvatarFile, |
82 | deleteActorAvatarFile, | 83 | deleteLocalActorAvatarFile, |
83 | pushAvatarProcessInQueue | 84 | pushAvatarProcessInQueue |
84 | } | 85 | } |