From aa887096f9a305568dc3a846d0c9cdf7e45f1c67 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 25 Oct 2022 14:18:59 +0200 Subject: Correctly delete live files from object storage --- server/lib/object-storage/videos.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'server/lib/object-storage/videos.ts') diff --git a/server/lib/object-storage/videos.ts b/server/lib/object-storage/videos.ts index 003807826..b764e4b22 100644 --- a/server/lib/object-storage/videos.ts +++ b/server/lib/object-storage/videos.ts @@ -11,6 +11,7 @@ import { lTags, makeAvailable, removeObject, + removeObjectByFullKey, removePrefix, storeObject, updateObjectACL, @@ -76,10 +77,18 @@ function removeHLSObjectStorage (playlist: MStreamingPlaylistVideo) { return removePrefix(generateHLSObjectBaseStorageKey(playlist), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) } -function removeHLSFileObjectStorage (playlist: MStreamingPlaylistVideo, filename: string) { +function removeHLSFileObjectStorageByFilename (playlist: MStreamingPlaylistVideo, filename: string) { return removeObject(generateHLSObjectStorageKey(playlist, filename), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) } +function removeHLSFileObjectStorageByPath (playlist: MStreamingPlaylistVideo, path: string) { + return removeObject(generateHLSObjectStorageKey(playlist, basename(path)), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) +} + +function removeHLSFileObjectStorageByFullKey (key: string) { + return removeObjectByFullKey(key, CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) +} + // --------------------------------------------------------------------------- function removeWebTorrentObjectStorage (videoFile: MVideoFile) { @@ -162,7 +171,10 @@ export { updateHLSFilesACL, removeHLSObjectStorage, - removeHLSFileObjectStorage, + removeHLSFileObjectStorageByFilename, + removeHLSFileObjectStorageByPath, + removeHLSFileObjectStorageByFullKey, + removeWebTorrentObjectStorage, makeWebTorrentFileAvailable, -- cgit v1.2.3