X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fobject-storage%2Fvideos.ts;h=66e738200ed329e2c7918b656c9b99bf78922374;hb=0d6843decdaecb4f726cba27fdb55fc164d00ba7;hp=8988f3e2a09d1daa8093e78913b25d7f668c09bc;hpb=ad5db1044c8599eaaaa2a578b350777ae996b068;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/object-storage/videos.ts b/server/lib/object-storage/videos.ts index 8988f3e2a..66e738200 100644 --- a/server/lib/object-storage/videos.ts +++ b/server/lib/object-storage/videos.ts @@ -6,11 +6,9 @@ import { getHLSDirectory } from '../paths' import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys' import { lTags, makeAvailable, removeObject, removePrefix, storeObject } from './shared' -function storeHLSFile (playlist: MStreamingPlaylistVideo, filename: string) { - const baseHlsDirectory = getHLSDirectory(playlist.Video) - +function storeHLSFile (playlist: MStreamingPlaylistVideo, filename: string, path?: string) { return storeObject({ - inputPath: join(baseHlsDirectory, filename), + inputPath: path ?? join(getHLSDirectory(playlist.Video), filename), objectStorageKey: generateHLSObjectStorageKey(playlist, filename), bucketInfo: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS }) @@ -28,6 +26,10 @@ function removeHLSObjectStorage (playlist: MStreamingPlaylistVideo) { return removePrefix(generateHLSObjectBaseStorageKey(playlist), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) } +function removeHLSFileObjectStorage (playlist: MStreamingPlaylistVideo, filename: string) { + return removeObject(generateHLSObjectStorageKey(playlist, filename), CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS) +} + function removeWebTorrentObjectStorage (videoFile: MVideoFile) { return removeObject(generateWebTorrentObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.VIDEOS) } @@ -65,6 +67,7 @@ export { storeHLSFile, removeHLSObjectStorage, + removeHLSFileObjectStorage, removeWebTorrentObjectStorage, makeWebTorrentFileAvailable,