Update mediaset.it.config.js

Fixes empty guide issue
This commit is contained in:
freearhey 2021-04-03 00:48:10 +03:00
parent 6e3afe0e94
commit d026d2a002

View file

@ -20,9 +20,10 @@ module.exports = {
}, },
parser: function ({ content, date }) { parser: function ({ content, date }) {
const programs = [] const programs = []
if (!content.events) return programs const data = JSON.parse(content)
if (!data.events) return programs
content.events.forEach(item => { data.events.forEach(item => {
if (item.title && item.startTime && item.endTime) { if (item.title && item.startTime && item.endTime) {
const start = dayjs const start = dayjs
.utc(item.startTime, 'HH:mm') .utc(item.startTime, 'HH:mm')