From f479685678406a5df864d89615b33d29085ebfc6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Apr 2021 11:35:56 +0200 Subject: Agnostic actor image storage --- scripts/prune-storage.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') 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 import * as Bluebird from 'bluebird' import { getUUIDFromFilename } from '../server/helpers/utils' import { ThumbnailModel } from '../server/models/video/thumbnail' -import { AvatarModel } from '../server/models/avatar/avatar' +import { ActorImageModel } from '../server/models/account/actor-image' import { uniq, values } from 'lodash' import { ThumbnailType } from '@shared/models' @@ -43,7 +43,7 @@ async function run () { await pruneDirectory(CONFIG.STORAGE.PREVIEWS_DIR, doesThumbnailExist(true, ThumbnailType.PREVIEW)), await pruneDirectory(CONFIG.STORAGE.THUMBNAILS_DIR, doesThumbnailExist(false, ThumbnailType.MINIATURE)), - await pruneDirectory(CONFIG.STORAGE.AVATARS_DIR, doesAvatarExist) + await pruneDirectory(CONFIG.STORAGE.ACTOR_IMAGES, doesActorImageExist) ) const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR) @@ -107,10 +107,10 @@ function doesThumbnailExist (keepOnlyOwned: boolean, type: ThumbnailType) { } } -async function doesAvatarExist (file: string) { - const avatar = await AvatarModel.loadByName(file) +async function doesActorImageExist (file: string) { + const image = await ActorImageModel.loadByName(file) - return !!avatar + return !!image } async function doesRedundancyExist (file: string) { -- cgit v1.2.3