aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/prune-storage.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/prune-storage.ts')
-rwxr-xr-xscripts/prune-storage.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts
index dcb1fcf90..bdfb335c6 100755
--- a/scripts/prune-storage.ts
+++ b/scripts/prune-storage.ts
@@ -11,7 +11,7 @@ import { VideoRedundancyModel } from '../server/models/redundancy/video-redundan
11import * as Bluebird from 'bluebird' 11import * as Bluebird from 'bluebird'
12import { getUUIDFromFilename } from '../server/helpers/utils' 12import { getUUIDFromFilename } from '../server/helpers/utils'
13import { ThumbnailModel } from '../server/models/video/thumbnail' 13import { ThumbnailModel } from '../server/models/video/thumbnail'
14import { AvatarModel } from '../server/models/avatar/avatar' 14import { ActorImageModel } from '../server/models/account/actor-image'
15import { uniq, values } from 'lodash' 15import { uniq, values } from 'lodash'
16import { ThumbnailType } from '@shared/models' 16import { ThumbnailType } from '@shared/models'
17 17
@@ -43,7 +43,7 @@ async function run () {
43 await pruneDirectory(CONFIG.STORAGE.PREVIEWS_DIR, doesThumbnailExist(true, ThumbnailType.PREVIEW)), 43 await pruneDirectory(CONFIG.STORAGE.PREVIEWS_DIR, doesThumbnailExist(true, ThumbnailType.PREVIEW)),
44 await pruneDirectory(CONFIG.STORAGE.THUMBNAILS_DIR, doesThumbnailExist(false, ThumbnailType.MINIATURE)), 44 await pruneDirectory(CONFIG.STORAGE.THUMBNAILS_DIR, doesThumbnailExist(false, ThumbnailType.MINIATURE)),
45 45
46 await pruneDirectory(CONFIG.STORAGE.AVATARS_DIR, doesAvatarExist) 46 await pruneDirectory(CONFIG.STORAGE.ACTOR_IMAGES, doesActorImageExist)
47 ) 47 )
48 48
49 const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR) 49 const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR)
@@ -107,10 +107,10 @@ function doesThumbnailExist (keepOnlyOwned: boolean, type: ThumbnailType) {
107 } 107 }
108} 108}
109 109
110async function doesAvatarExist (file: string) { 110async function doesActorImageExist (file: string) {
111 const avatar = await AvatarModel.loadByName(file) 111 const image = await ActorImageModel.loadByName(file)
112 112
113 return !!avatar 113 return !!image
114} 114}
115 115
116async function doesRedundancyExist (file: string) { 116async function doesRedundancyExist (file: string) {