From c13dda8473923bd4c8c2be85b9fad7febb624626 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 18 Sep 2023 19:21:55 +0300 Subject: [PATCH] Update store.js --- src/store.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/store.js b/src/store.js index f1404c75e..708889d58 100644 --- a/src/store.js +++ b/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())