mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update update-api.js
This commit is contained in:
parent
4e28c1a119
commit
8baeed2247
3 changed files with 10 additions and 14 deletions
|
@ -14,19 +14,18 @@ main()
|
|||
async function loadGuides() {
|
||||
logger.info('Loading guides from database...')
|
||||
|
||||
await db.channels.load()
|
||||
await db.queue.load()
|
||||
|
||||
const channels = await db.channels.find({}).sort({ xmltv_id: 1 })
|
||||
const queue = await db.queue.find({}).sort({ xmltv_id: 1 })
|
||||
|
||||
const output = []
|
||||
for (const channel of channels) {
|
||||
channel.groups.forEach(group => {
|
||||
if (channel.programCount) {
|
||||
for (const item of queue) {
|
||||
item.groups.forEach(group => {
|
||||
if (item.programCount) {
|
||||
output.push({
|
||||
channel: channel.xmltv_id,
|
||||
display_name: channel.name,
|
||||
site: channel.site,
|
||||
lang: channel.lang,
|
||||
channel: item.xmltv_id,
|
||||
site: item.site,
|
||||
lang: item.lang,
|
||||
url: `https://iptv-org.github.io/epg/guides/${group}.epg.xml`
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue