mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-13 18:40:06 -04:00
Update +page.server.js
This commit is contained in:
parent
0f50bfe4b2
commit
4886e5c1f6
1 changed files with 6 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
||||||
import { error } from '@sveltejs/kit'
|
|
||||||
import { transformChannel } from '~/store'
|
import { transformChannel } from '~/store'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import channels from '~/data/channels.json'
|
import channels from '~/data/channels.json'
|
||||||
|
@ -9,6 +8,9 @@ import categories from '~/data/categories.json'
|
||||||
import blocklist from '~/data/blocklist.json'
|
import blocklist from '~/data/blocklist.json'
|
||||||
import languages from '~/data/languages.json'
|
import languages from '~/data/languages.json'
|
||||||
import streams from '~/data/streams.json'
|
import streams from '~/data/streams.json'
|
||||||
|
import isURL from 'validator/lib/isURL'
|
||||||
|
|
||||||
|
let _streams = streams.filter(stream => isURL(stream.url))
|
||||||
|
|
||||||
const data = {}
|
const data = {}
|
||||||
data.countries = _.keyBy(countries, 'code')
|
data.countries = _.keyBy(countries, 'code')
|
||||||
|
@ -16,12 +18,12 @@ data.regions = _.keyBy(regions, 'code')
|
||||||
data.subdivisions = _.keyBy(subdivisions, 'code')
|
data.subdivisions = _.keyBy(subdivisions, 'code')
|
||||||
data.languages = _.keyBy(languages, 'code')
|
data.languages = _.keyBy(languages, 'code')
|
||||||
data.categories = _.keyBy(categories, 'id')
|
data.categories = _.keyBy(categories, 'id')
|
||||||
data.streams = _.groupBy(streams, 'channel')
|
data.streams = _.groupBy(_streams, 'channel')
|
||||||
data.blocklist = _.groupBy(blocklist, 'channel')
|
data.blocklist = _.groupBy(blocklist, 'channel')
|
||||||
data.channels = _.keyBy(channels, channel => channel.id.toLowerCase())
|
data.channels = _.keyBy(channels, channel => channel.id.toLowerCase())
|
||||||
|
|
||||||
export async function entries() {
|
export function entries() {
|
||||||
return channels.map(channel => {
|
return Object.values(data.channels).map(channel => {
|
||||||
const [name, country] = channel.id.split('.')
|
const [name, country] = channel.id.split('.')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue