From 34023e12534f22f28d0b5afc1db3fdf2fd1e7e60 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 May 2023 11:16:05 +0200 Subject: Fix S3 live sync Ensure TS chunks referenced in M3U8 playlist are already uploaded on S3 --- server/lib/object-storage/videos.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (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 bfdef94fd..57d978e4c 100644 --- a/server/lib/object-storage/videos.ts +++ b/server/lib/object-storage/videos.ts @@ -42,6 +42,15 @@ function storeHLSFileFromPath (playlist: MStreamingPlaylistVideo, path: string) }) } +function storeHLSFileFromContent (playlist: MStreamingPlaylistVideo, path: string, content: string) { + return storeObject({ + inputPath: path, + objectStorageKey: generateHLSObjectStorageKey(playlist, basename(path)), + bucketInfo: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS, + isPrivate: playlist.Video.hasPrivateStaticPath() + }) +} + // --------------------------------------------------------------------------- function storeWebTorrentFile (video: MVideo, file: MVideoFile) { @@ -166,6 +175,7 @@ export { storeWebTorrentFile, storeHLSFileFromFilename, storeHLSFileFromPath, + storeHLSFileFromContent, updateWebTorrentFileACL, updateHLSFilesACL, -- cgit v1.2.3