diff --git a/addon/moch/alldebrid.js b/addon/moch/alldebrid.js index d2a766a..901ca6c 100644 --- a/addon/moch/alldebrid.js +++ b/addon/moch/alldebrid.js @@ -62,10 +62,8 @@ async function getItemMeta(itemId, apiKey) { .map((file, index) => ({ id: `${KEY}:${torrent.id}:${index}`, title: file.filename, - released: new Date(torrent.uploadDate * 1000 + index).toISOString(), - streams: [ - { url: `${apiKey}/${torrent.hash.toLowerCase()}/${encodeURIComponent(file.filename)}/${index}` } - ] + released: new Date(torrent.uploadDate * 1000 - index).toISOString(), + stream: { url: `${apiKey}/${torrent.hash.toLowerCase()}/${encodeURIComponent(file.filename)}/${index}` } })) })) } diff --git a/addon/moch/moch.js b/addon/moch/moch.js index bd0450a..6bae156 100644 --- a/addon/moch/moch.js +++ b/addon/moch/moch.js @@ -110,8 +110,9 @@ async function getMochItemMeta(mochKey, itemId, config) { return moch.instance.getItemMeta(itemId, config[moch.key], config.ip) .then(meta => { meta.videos - .map(video => video.streams) - .reduce((a, b) => a.concat(b), []) + // .map(video => video.streams) + // .reduce((a, b) => a.concat(b), []) + .map(video => video.stream) .filter(stream => !stream.url.startsWith('http')) .forEach(stream => stream.url = `${RESOLVER_HOST}/${moch.key}/${stream.url}`) return meta; diff --git a/addon/moch/premiumize.js b/addon/moch/premiumize.js index 978a440..2caccbf 100644 --- a/addon/moch/premiumize.js +++ b/addon/moch/premiumize.js @@ -61,9 +61,7 @@ async function getItemMeta(itemId, apiKey, ip) { id: `${KEY}:${file.id}:${index}`, title: file.name, released: new Date(file.created_at * 1000 - index).toISOString(), - streams: [ - { url: file.stream_link || file.link } - ] + stream: { url: file.stream_link || file.link } })) })) } diff --git a/addon/moch/realdebrid.js b/addon/moch/realdebrid.js index c124373..89cbf14 100644 --- a/addon/moch/realdebrid.js +++ b/addon/moch/realdebrid.js @@ -111,10 +111,8 @@ async function getItemMeta(itemId, apiKey, ip) { .map((file, index) => ({ id: `${KEY}:${torrent.id}:${file.id}`, title: file.path, - released: new Date(new Date(torrent.added).getTime() + index).toISOString(), - streams: [ - { url: `${apiKey}/${torrent.hash.toLowerCase()}/null/${file.id - 1}` } - ] + released: new Date(new Date(torrent.added).getTime() - index).toISOString(), + stream: { url: `${apiKey}/${torrent.hash.toLowerCase()}/null/${file.id - 1}` } })) })) }