return only streams property for moch meta

This commit is contained in:
TheBeastLT
2022-03-09 15:54:39 +01:00
parent 5100751c19
commit 29b232318e
5 changed files with 9 additions and 10 deletions

View File

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