aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/object-storage/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-25 14:18:59 +0200
committerChocobozzz <me@florianbigard.com>2022-10-25 14:18:59 +0200
commitaa887096f9a305568dc3a846d0c9cdf7e45f1c67 (patch)
tree5dc455d680ebdd24644ebe29b2f129afb903b421 /server/lib/object-storage/videos.ts
parent508c1b1e9f3b26752a961e945b7fa59b72b30827 (diff)
downloadPeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.tar.gz
PeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.tar.zst
PeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.zip
Correctly delete live files from object storage
Diffstat (limited to 'server/lib/object-storage/videos.ts')
-rw-r--r--server/lib/object-storage/videos.ts16
1 files changed, 14 insertions, 2 deletions
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 {
11 lTags, 11 lTags,
12 makeAvailable, 12 makeAvailable,
13 removeObject, 13 removeObject,
14 removeObjectByFullKey,
14 removePrefix, 15 removePrefix,
15 storeObject, 16 storeObject,
16 updateObjectACL, 17 updateObjectACL,
@@ -76,10 +77,18 @@ function removeHLSObjectStorage (playlist: MStreamingPlaylistVideo) {
76 return removePrefix(generateHLSObjectBaseStorageKey(playlist), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) 77 return removePrefix(generateHLSObjectBaseStorageKey(playlist), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS)
77} 78}
78 79
79function removeHLSFileObjectStorage (playlist: MStreamingPlaylistVideo, filename: string) { 80function removeHLSFileObjectStorageByFilename (playlist: MStreamingPlaylistVideo, filename: string) {
80 return removeObject(generateHLSObjectStorageKey(playlist, filename), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) 81 return removeObject(generateHLSObjectStorageKey(playlist, filename), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS)
81} 82}
82 83
84function removeHLSFileObjectStorageByPath (playlist: MStreamingPlaylistVideo, path: string) {
85 return removeObject(generateHLSObjectStorageKey(playlist, basename(path)), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS)
86}
87
88function removeHLSFileObjectStorageByFullKey (key: string) {
89 return removeObjectByFullKey(key, CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS)
90}
91
83// --------------------------------------------------------------------------- 92// ---------------------------------------------------------------------------
84 93
85function removeWebTorrentObjectStorage (videoFile: MVideoFile) { 94function removeWebTorrentObjectStorage (videoFile: MVideoFile) {
@@ -162,7 +171,10 @@ export {
162 updateHLSFilesACL, 171 updateHLSFilesACL,
163 172
164 removeHLSObjectStorage, 173 removeHLSObjectStorage,
165 removeHLSFileObjectStorage, 174 removeHLSFileObjectStorageByFilename,
175 removeHLSFileObjectStorageByPath,
176 removeHLSFileObjectStorageByFullKey,
177
166 removeWebTorrentObjectStorage, 178 removeWebTorrentObjectStorage,
167 179
168 makeWebTorrentFileAvailable, 180 makeWebTorrentFileAvailable,