From 8059e050ef4e800c95851ac97abbb2330fe17882 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Jan 2023 08:30:56 +0100 Subject: Fix live with base url object storage --- server/lib/live/live-manager.ts | 4 +++- server/lib/object-storage/urls.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'server/lib') diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts index 9ea983119..fa4e1df07 100644 --- a/server/lib/live/live-manager.ts +++ b/server/lib/live/live-manager.ts @@ -487,7 +487,9 @@ class LiveManager { ? VideoStorage.OBJECT_STORAGE : VideoStorage.FILE_SYSTEM - playlist.assignP2PMediaLoaderInfoHashes(video, allResolutions) + if (playlist.storage === VideoStorage.FILE_SYSTEM) { + playlist.assignP2PMediaLoaderInfoHashes(video, allResolutions) + } return playlist.save() } diff --git a/server/lib/object-storage/urls.ts b/server/lib/object-storage/urls.ts index a47a98b98..b8ef94559 100644 --- a/server/lib/object-storage/urls.ts +++ b/server/lib/object-storage/urls.ts @@ -57,5 +57,7 @@ function getBaseUrl (bucketInfo: BucketInfo, baseUrl?: string) { const regex = new RegExp('https?://[^/]+') function replaceByBaseUrl (fileUrl: string, baseUrl: string) { + if (!fileUrl) return fileUrl + return fileUrl.replace(regex, baseUrl) } -- cgit v1.2.3