From ec746f57a738cd85d2f43d8d543cb6329e4dfbb0 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Sat, 27 Apr 2024 10:48:22 +0000 Subject: [PATCH] stream/manage: pass service name to internal stream --- src/modules/stream/manage.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/stream/manage.js b/src/modules/stream/manage.js index 680fd8f9..8b6b8c62 100644 --- a/src/modules/stream/manage.js +++ b/src/modules/stream/manage.js @@ -79,6 +79,7 @@ export function createInternalStream(obj = {}) { const streamID = nanoid(); internalStreamCache[streamID] = { url: obj.url, + service: obj.service, controller: new AbortController() }; @@ -117,10 +118,16 @@ export function verifyStream(id, hmac, exp, secret, iv) { } if (typeof streamInfo.originalUrls === 'string') { - streamInfo.urls = createInternalStream({ url: streamInfo.originalUrls }); + streamInfo.urls = createInternalStream({ + url: streamInfo.originalUrls, + ...streamInfo + }); } else if (Array.isArray(streamInfo.originalUrls)) { for (const idx in streamInfo.originalUrls) { - streamInfo.originalUrls[idx] = createInternalStream({ url: streamInfo.originalUrls[idx] }); + streamInfo.originalUrls[idx] = createInternalStream({ + url: streamInfo.originalUrls[idx], + ...streamInfo + }); } } else throw 'invalid urls';