mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-14 11:00:05 -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>
|
<td class="is-vcentered" nowrap>
|
||||||
<code v-text="channel.id"></code>
|
<code v-text="channel.id"></code>
|
||||||
</td>
|
</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>
|
</tr>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
@ -96,6 +99,7 @@ const CountryItem = {
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>TVG-ID</th>
|
<th>TVG-ID</th>
|
||||||
|
<th>EPG</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -128,19 +132,18 @@ const App = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
// NOTE: epg/guides.json temporary anavailable
|
let guides = await fetch('https://iptv-org.github.io/api/guides.json')
|
||||||
// const guides = await fetch('https://iptv-org.github.io/epg/guides.json')
|
.then(response => response.json())
|
||||||
// .then(response => response.json())
|
.catch(console.log)
|
||||||
// .catch(console.log)
|
guides = guides.length ? guides : []
|
||||||
const guides = []
|
guides = _.groupBy(guides, 'channel')
|
||||||
|
|
||||||
const channels = await fetch('https://iptv-org.github.io/api/channels.json')
|
const channels = await fetch('https://iptv-org.github.io/api/channels.json')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(arr =>
|
.then(arr =>
|
||||||
arr.map(c => {
|
arr.map(c => {
|
||||||
const found = guides.filter(g => g.channel === c.id)
|
|
||||||
c.key = `${c.id}_${c.name}`.replace(/\s/g, '').toLowerCase()
|
c.key = `${c.id}_${c.name}`.replace(/\s/g, '').toLowerCase()
|
||||||
c.guides = found.map(f => f.url) || []
|
c.guides = guides[c.id] || []
|
||||||
return c
|
return c
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue