mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-11 17:40:05 -04:00
Update +page.server.js
This commit is contained in:
parent
46c3780592
commit
768357b9ef
1 changed files with 5 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
|||
import { error } from '@sveltejs/kit'
|
||||
import { transformChannel } from '~/store'
|
||||
import _ from 'lodash'
|
||||
import channels from '~/data/channels.json'
|
||||
|
@ -35,12 +36,12 @@ export function load({ params }) {
|
|||
const name = params.name
|
||||
const id = `${name}.${country}`.toLowerCase()
|
||||
|
||||
let channel = data.channels[id] || {}
|
||||
if (channel) {
|
||||
channel = transformChannel(channel, data)
|
||||
let channel = data.channels[id]
|
||||
if (!channel) {
|
||||
throw error(404, 'Not Found')
|
||||
}
|
||||
|
||||
return {
|
||||
channel
|
||||
channel: transformChannel(channel, data)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue