Update digiturk.com.tr.config.js

This commit is contained in:
Aleksandr Statciuk 2021-11-10 13:49:59 +03:00
parent 57385b4359
commit 7ba13812bb

View file

@ -10,6 +10,9 @@ module.exports = {
channel.site_id channel.site_id
}/${date.format('YYYY-MM-DD')}/0` }/${date.format('YYYY-MM-DD')}/0`
}, },
logo({ channel }) {
return channel.logo
},
parser: function ({ content, channel }) { parser: function ({ content, channel }) {
const programs = [] const programs = []
const items = parseItems(content, channel) const items = parseItems(content, channel)
@ -18,8 +21,8 @@ module.exports = {
title: item.ProgramName, title: item.ProgramName,
description: item.LongDescription, description: item.LongDescription,
category: parseCategory(item), category: parseCategory(item),
start: parseStart(item), start: parseStart(item).toJSON(),
stop: parseStop(item) stop: parseStop(item).toJSON()
}) })
}) })
@ -64,7 +67,7 @@ function parseCategory(item) {
function parseItems(content, channel) { function parseItems(content, channel) {
const data = JSON.parse(content) const data = JSON.parse(content)
const items = data.listings[channel.site_id] const items = data.listings[channel.site_id]
if (!items.length) return [] if (!Array.isArray(items)) return []
return items return items
} }