diff --git a/app.js b/app.js index 9cf563493..c10cd8e81 100644 --- a/app.js +++ b/app.js @@ -17,6 +17,9 @@ const ChannelItem = { + +

+ ` } @@ -96,6 +99,7 @@ const CountryItem = { Name TVG-ID + EPG @@ -128,19 +132,18 @@ const App = { } }, async mounted() { - // NOTE: epg/guides.json temporary anavailable - // const guides = await fetch('https://iptv-org.github.io/epg/guides.json') - // .then(response => response.json()) - // .catch(console.log) - const guides = [] + let guides = await fetch('https://iptv-org.github.io/api/guides.json') + .then(response => response.json()) + .catch(console.log) + guides = guides.length ? guides : [] + guides = _.groupBy(guides, 'channel') const channels = await fetch('https://iptv-org.github.io/api/channels.json') .then(response => response.json()) .then(arr => arr.map(c => { - const found = guides.filter(g => g.channel === c.id) c.key = `${c.id}_${c.name}`.replace(/\s/g, '').toLowerCase() - c.guides = found.map(f => f.url) || [] + c.guides = guides[c.id] || [] return c }) )