From d4d48a0bc59568b902cccafae232f4f22317359f Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 7 Nov 2022 21:45:07 +0300 Subject: [PATCH] Update i.mjh.nz.config.js --- sites/i.mjh.nz/i.mjh.nz.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sites/i.mjh.nz/i.mjh.nz.config.js b/sites/i.mjh.nz/i.mjh.nz.config.js index ce6fcaef..9c7936e0 100644 --- a/sites/i.mjh.nz/i.mjh.nz.config.js +++ b/sites/i.mjh.nz/i.mjh.nz.config.js @@ -35,15 +35,15 @@ module.exports = { return programs }, - async channels({ service, region = 'all', lang = 'en' }) { - const data = await axios + async channels({ path, lang = 'en' }) { + const [service] = path.split('/') + let data = await axios .get(`https://i.mjh.nz/${service}/app.json`) .then(r => r.data) .catch(console.log) const channels = [] - const items = region === 'all' ? data.channels : data.regions[region].channels - const path = `${service}/${region}` + const items = data.channels || data for (let id in items) { const channel = items[id] channels.push({