From 90701ec1d8d27d0072d6b0d2b19362d471484f9a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Dec 2021 10:28:46 +0100 Subject: Add hls to prune storage script --- scripts/prune-storage.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index 9df80d503..12d78fdc6 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts @@ -15,7 +15,8 @@ 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' +import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' +import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' run() .then(() => process.exit(0)) @@ -40,6 +41,9 @@ async function run () { toDelete = toDelete.concat( await pruneDirectory(CONFIG.STORAGE.VIDEOS_DIR, doesWebTorrentFileExist()), + + await pruneDirectory(HLS_STREAMING_PLAYLIST_DIRECTORY, doesHLSPlaylistExist()), + await pruneDirectory(CONFIG.STORAGE.TORRENTS_DIR, doesTorrentFileExist()), await pruneDirectory(CONFIG.STORAGE.REDUNDANCY_DIR, doesRedundancyExist), @@ -94,6 +98,10 @@ function doesWebTorrentFileExist () { return (filePath: string) => VideoFileModel.doesOwnedWebTorrentVideoFileExist(basename(filePath)) } +function doesHLSPlaylistExist () { + return (hlsPath: string) => VideoStreamingPlaylistModel.doesOwnedHLSPlaylistExist(basename(hlsPath)) +} + function doesTorrentFileExist () { return (filePath: string) => VideoFileModel.doesOwnedTorrentFileExist(basename(filePath)) } -- cgit v1.2.3