From 2c4da0679f369f806aa7f95078bf41a7d2439d79 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Sat, 16 Dec 2023 14:59:17 +0200 Subject: [PATCH] add bingeGroup for debrid meta streams --- addon/moch/moch.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addon/moch/moch.js b/addon/moch/moch.js index 5deca58..1efe2de 100644 --- a/addon/moch/moch.js +++ b/addon/moch/moch.js @@ -143,10 +143,12 @@ export async function getMochItemMeta(mochKey, itemId, config) { return moch.instance.getItemMeta(itemId, config[moch.key], config.ip) .then(meta => enrichMeta(meta)) .then(meta => { - meta.videos - .map(video => video.streams - .filter(stream => !stream.url.startsWith('http')) - .forEach(stream => stream.url = `${config.host}/${moch.key}/${stream.url}/${streamFilename(video)}`)) + meta.videos.forEach(video => video.streams.forEach(stream => { + if (!stream.url.startsWith('http')) { + stream.url = `${config.host}/${moch.key}/${stream.url}/${streamFilename(video)}` + } + stream.behaviorHints = { bingeGroup: itemId } + })) return meta; }); }