[addon] return both stream and streams property in moch meta response

This commit is contained in:
TheBeastLT
2021-03-10 16:33:14 +01:00
parent bb8f3fc990
commit 1c6447add6

View File

@@ -117,12 +117,12 @@ async function getMochItemMeta(mochKey, itemId, config) {
return moch.instance.getItemMeta(itemId, config[moch.key], config.ip) return moch.instance.getItemMeta(itemId, config[moch.key], config.ip)
.then(meta => { .then(meta => {
meta.videos meta.videos.forEach(video => {
// .map(video => video.streams) if (!video.stream.url.startsWith('http')) {
// .reduce((a, b) => a.concat(b), []) video.stream.url = `${RESOLVER_HOST}/${moch.key}/${video.stream.url}`
.map(video => video.stream) }
.filter(stream => !stream.url.startsWith('http')) video.streams = [video.stream];
.forEach(stream => stream.url = `${RESOLVER_HOST}/${moch.key}/${stream.url}`) });
return meta; return meta;
}); });
} }