diff options
author | Chocobozzz <me@florianbigard.com> | 2021-09-02 15:10:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-09-02 15:10:40 +0200 |
commit | 2ede07153ce0282b116345dfee09bff902355a75 (patch) | |
tree | 52467687f2967d61a67051266c02293e1bc46506 /scripts/prune-storage.ts | |
parent | 4d557df51c2ad8a87b9789b3caccc95c9880a944 (diff) | |
download | PeerTube-2ede07153ce0282b116345dfee09bff902355a75.tar.gz PeerTube-2ede07153ce0282b116345dfee09bff902355a75.tar.zst PeerTube-2ede07153ce0282b116345dfee09bff902355a75.zip |
Fix hls redundancy pruning
Diffstat (limited to 'scripts/prune-storage.ts')
-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 |