diff options
-rwxr-xr-x | scripts/prune-storage.ts | 4 |
1 files changed, 4 insertions, 0 deletions
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' | |||
15 | import { uniq, values } from 'lodash' | 15 | import { uniq, values } from 'lodash' |
16 | import { ThumbnailType } from '@shared/models' | 16 | import { ThumbnailType } from '@shared/models' |
17 | import { VideoFileModel } from '@server/models/video/video-file' | 17 | import { VideoFileModel } from '@server/models/video/video-file' |
18 | import { HLS_REDUNDANCY_DIRECTORY } from '@server/initializers/constants' | ||
18 | 19 | ||
19 | run() | 20 | run() |
20 | .then(() => process.exit(0)) | 21 | .then(() => process.exit(0)) |
@@ -121,6 +122,9 @@ async function doesRedundancyExist (filePath: string) { | |||
121 | const isPlaylist = (await stat(filePath)).isDirectory() | 122 | const isPlaylist = (await stat(filePath)).isDirectory() |
122 | 123 | ||
123 | if (isPlaylist) { | 124 | if (isPlaylist) { |
125 | // Don't delete HLS directory | ||
126 | if (filePath === HLS_REDUNDANCY_DIRECTORY) return true | ||
127 | |||
124 | const uuid = getUUIDFromFilename(filePath) | 128 | const uuid = getUUIDFromFilename(filePath) |
125 | const video = await VideoModel.loadWithFiles(uuid) | 129 | const video = await VideoModel.loadWithFiles(uuid) |
126 | if (!video) return false | 130 | if (!video) return false |