aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xscripts/prune-storage.ts4
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'
15import { uniq, values } from 'lodash' 15import { uniq, values } from 'lodash'
16import { ThumbnailType } from '@shared/models' 16import { ThumbnailType } from '@shared/models'
17import { VideoFileModel } from '@server/models/video/video-file' 17import { VideoFileModel } from '@server/models/video/video-file'
18import { HLS_REDUNDANCY_DIRECTORY } from '@server/initializers/constants'
18 19
19run() 20run()
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