mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update mts.rs.config.js
This commit is contained in:
parent
bbbb109586
commit
59aeea2ada
1 changed files with 6 additions and 6 deletions
|
@ -27,15 +27,13 @@ module.exports = {
|
||||||
const data = parseContent(content, channel)
|
const data = parseContent(content, channel)
|
||||||
const items = parseItems(data)
|
const items = parseItems(data)
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
const start = parseStart(item)
|
|
||||||
const stop = parseStop(item)
|
|
||||||
programs.push({
|
programs.push({
|
||||||
title: item.title,
|
title: item.title,
|
||||||
category: item.category,
|
category: item.category,
|
||||||
description: item.description,
|
description: item.description,
|
||||||
icon: item.image,
|
icon: item.image,
|
||||||
start: start.toJSON(),
|
start: parseStart(item),
|
||||||
stop: stop.toJSON()
|
stop: parseStop(item)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -45,8 +43,10 @@ module.exports = {
|
||||||
|
|
||||||
function parseContent(content, channel) {
|
function parseContent(content, channel) {
|
||||||
const [_, site_id] = channel.site_id.split('#')
|
const [_, site_id] = channel.site_id.split('#')
|
||||||
if (!content) return null
|
let data
|
||||||
const data = JSON.parse(content)
|
try {
|
||||||
|
data = JSON.parse(content)
|
||||||
|
} catch (e) {}
|
||||||
if (!data || !data.channels || !data.channels.length) return null
|
if (!data || !data.channels || !data.channels.length) return null
|
||||||
|
|
||||||
return data.channels.find(c => c.id === site_id) || null
|
return data.channels.find(c => c.id === site_id) || null
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue