aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/prune-storage.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-09-02 15:10:30 +0200
committerChocobozzz <me@florianbigard.com>2021-09-02 15:10:40 +0200
commit2ede07153ce0282b116345dfee09bff902355a75 (patch)
tree52467687f2967d61a67051266c02293e1bc46506 /scripts/prune-storage.ts
parent4d557df51c2ad8a87b9789b3caccc95c9880a944 (diff)
downloadPeerTube-2ede07153ce0282b116345dfee09bff902355a75.tar.gz
PeerTube-2ede07153ce0282b116345dfee09bff902355a75.tar.zst
PeerTube-2ede07153ce0282b116345dfee09bff902355a75.zip
Fix hls redundancy pruning
Diffstat (limited to 'scripts/prune-storage.ts')
-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