aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/files-cache/avatar-permanent-file-cache.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/files-cache/avatar-permanent-file-cache.ts')
-rw-r--r--server/lib/files-cache/avatar-permanent-file-cache.ts27
1 files changed, 0 insertions, 27 deletions
diff --git a/server/lib/files-cache/avatar-permanent-file-cache.ts b/server/lib/files-cache/avatar-permanent-file-cache.ts
deleted file mode 100644
index 0c508b063..000000000
--- a/server/lib/files-cache/avatar-permanent-file-cache.ts
+++ /dev/null
@@ -1,27 +0,0 @@
1import { CONFIG } from '@server/initializers/config'
2import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants'
3import { ActorImageModel } from '@server/models/actor/actor-image'
4import { MActorImage } from '@server/types/models'
5import { AbstractPermanentFileCache } from './shared'
6
7export class AvatarPermanentFileCache extends AbstractPermanentFileCache<MActorImage> {
8
9 constructor () {
10 super(CONFIG.STORAGE.ACTOR_IMAGES_DIR)
11 }
12
13 protected loadModel (filename: string) {
14 return ActorImageModel.loadByName(filename)
15 }
16
17 protected getImageSize (image: MActorImage): { width: number, height: number } {
18 if (image.width && image.height) {
19 return {
20 height: image.height,
21 width: image.width
22 }
23 }
24
25 return ACTOR_IMAGES_SIZE[image.type][0]
26 }
27}