Update utils.js

Throws an error if a channel does not have a name
This commit is contained in:
freearhey 2021-03-28 23:58:02 +03:00
parent 906cc97fb6
commit ab027db13e
1 changed files with 1 additions and 0 deletions

View File

@ -60,6 +60,7 @@ utils.parseChannels = function (filename) {
.filter(el => el.name === 'channel')
.map(el => {
const channel = el.attributes
if (!el.elements) throw new Error(`Channel '${channel.xmltv_id}' has no valid name`)
channel.name = el.elements.find(el => el.type === 'text').text
channel.site = channel.site || site.attributes.site