Update update-api.js

This commit is contained in:
Aleksandr Statciuk 2022-01-15 03:04:15 +03:00
parent 421fa4580c
commit 2563aab667
2 changed files with 8 additions and 4 deletions

View file

@ -26,16 +26,20 @@ async function loadChannels() {
if (!output[item.xmltv_id]) {
output[item.xmltv_id] = {
id: item.xmltv_id,
name: [item.name],
name: [],
logo: item.logo || null,
country: item.country
country: item.country,
guides: []
}
} else {
output[item.xmltv_id].logo = output[item.xmltv_id].logo || item.logo
output[item.xmltv_id].name.push(item.name)
}
output[item.xmltv_id].name.push(item.name)
output[item.xmltv_id].name = _.uniq(output[item.xmltv_id].name)
output[item.xmltv_id].guides.push(
`https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml`
)
})
return Object.values(output)