From 2ede07153ce0282b116345dfee09bff902355a75 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 2 Sep 2021 15:10:30 +0200 Subject: [PATCH] Fix hls redundancy pruning --- scripts/prune-storage.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index 00141fec1..9df80d503 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts @@ -15,6 +15,7 @@ import { ActorImageModel } from '../server/models/actor/actor-image' import { uniq, values } from 'lodash' import { ThumbnailType } from '@shared/models' import { VideoFileModel } from '@server/models/video/video-file' +import { HLS_REDUNDANCY_DIRECTORY } from '@server/initializers/constants' run() .then(() => process.exit(0)) @@ -121,6 +122,9 @@ async function doesRedundancyExist (filePath: string) { const isPlaylist = (await stat(filePath)).isDirectory() if (isPlaylist) { + // Don't delete HLS directory + if (filePath === HLS_REDUNDANCY_DIRECTORY) return true + const uuid = getUUIDFromFilename(filePath) const video = await VideoModel.loadWithFiles(uuid) if (!video) return false