mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-11 17:40:05 -04:00
Update store.js
This commit is contained in:
parent
2a19808b5a
commit
c13dda8473
1 changed files with 11 additions and 2 deletions
13
src/store.js
13
src/store.js
|
@ -50,7 +50,8 @@ export async function fetchChannels() {
|
|||
return { type, ...api.subdivisions[code] }
|
||||
}
|
||||
})
|
||||
c.is = c.closed || c.replaced_by ? 'closed' : 'active'
|
||||
c.is_closed = !!c.closed || !!c.replaced_by
|
||||
c.is_blocked = !!api.blocklist[c.id]
|
||||
c.streams = c._streams.length
|
||||
c.guides = c._guides.length
|
||||
|
||||
|
@ -76,7 +77,9 @@ export async function fetchChannels() {
|
|||
'replaced_by',
|
||||
'streams',
|
||||
'guides',
|
||||
'is'
|
||||
'is_nsfw',
|
||||
'is_closed',
|
||||
'is_blocked'
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -143,6 +146,12 @@ async function loadAPI() {
|
|||
.then(data => _.groupBy(data, 'channel'))
|
||||
.catch(console.error)
|
||||
|
||||
api.blocklist = await fetch('https://iptv-org.github.io/api/blocklist.json')
|
||||
.then(r => r.json())
|
||||
.then(data => (data.length ? data : []))
|
||||
.then(data => _.groupBy(data, 'channel'))
|
||||
.catch(console.error)
|
||||
|
||||
api.guides = {}
|
||||
// api.guides = await fetch('https://iptv-org.github.io/api/guides.json')
|
||||
// .then(r => r.json())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue