mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-14 02:50:07 -04:00
Update app.js
This commit is contained in:
parent
5919c388fe
commit
d314b31071
1 changed files with 10 additions and 7 deletions
17
app.js
17
app.js
|
@ -17,6 +17,9 @@ const ChannelItem = {
|
|||
<td class="is-vcentered" nowrap>
|
||||
<code v-text="channel.id"></code>
|
||||
</td>
|
||||
<td class="is-vcentered">
|
||||
<p v-for="guide in channel.guides"><code style="white-space: nowrap" v-text="guide.url"></code></p>
|
||||
</td>
|
||||
</tr>
|
||||
`
|
||||
}
|
||||
|
@ -96,6 +99,7 @@ const CountryItem = {
|
|||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>TVG-ID</th>
|
||||
<th>EPG</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -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
|
||||
})
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue