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 --- .../lib/object-storage/shared/object-storage-helpers.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'server/lib/object-storage/shared') diff --git a/server/lib/object-storage/shared/object-storage-helpers.ts b/server/lib/object-storage/shared/object-storage-helpers.ts index be94b01a8..f517c5f69 100644 --- a/server/lib/object-storage/shared/object-storage-helpers.ts +++ b/server/lib/object-storage/shared/object-storage-helpers.ts @@ -59,6 +59,20 @@ async function storeObject (options: { return uploadToStorage({ objectStorageKey, content: fileStream, bucketInfo, isPrivate }) } +async function storeContent (options: { + content: string + inputPath: string + objectStorageKey: string + bucketInfo: BucketInfo + isPrivate: boolean +}): Promise { + const { content, objectStorageKey, bucketInfo, inputPath, isPrivate } = options + + logger.debug('Uploading %s content to %s%s in bucket %s', inputPath, bucketInfo.PREFIX, objectStorageKey, bucketInfo.BUCKET_NAME, lTags()) + + return uploadToStorage({ objectStorageKey, content, bucketInfo, isPrivate }) +} + // --------------------------------------------------------------------------- async function updateObjectACL (options: { @@ -206,6 +220,7 @@ export { buildKey, storeObject, + storeContent, removeObject, removeObjectByFullKey, @@ -223,7 +238,7 @@ export { // --------------------------------------------------------------------------- async function uploadToStorage (options: { - content: ReadStream + content: ReadStream | string objectStorageKey: string bucketInfo: BucketInfo isPrivate: boolean -- cgit v1.2.3