mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 10:56:57 -05:00
Update parser.js
This commit is contained in:
@@ -7,7 +7,10 @@ parser.parseChannels = function (xml) {
|
||||
const siteTag = result.elements.find(el => el.name === 'site')
|
||||
const channelsTags = siteTag.elements.filter(el => el.name === 'channels')
|
||||
|
||||
let output = []
|
||||
const output = {
|
||||
site: siteTag.attributes.site,
|
||||
groups: []
|
||||
}
|
||||
|
||||
channelsTags.forEach(channelsTag => {
|
||||
const channels = channelsTag.elements
|
||||
@@ -21,7 +24,11 @@ parser.parseChannels = function (xml) {
|
||||
|
||||
return channel
|
||||
})
|
||||
output = output.concat(channels)
|
||||
|
||||
output.groups.push({
|
||||
country: channelsTag.attributes.country,
|
||||
channels
|
||||
})
|
||||
})
|
||||
|
||||
return output
|
||||
|
||||
Reference in New Issue
Block a user