mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
wip
This commit is contained in:
parent
f8981e478e
commit
043d738c95
14 changed files with 134 additions and 9 deletions
|
@ -12,6 +12,7 @@ async function main() {
|
|||
await setUp()
|
||||
|
||||
await generateMainXML()
|
||||
await generateCountries()
|
||||
}
|
||||
|
||||
main()
|
||||
|
@ -32,6 +33,32 @@ async function generateMainXML() {
|
|||
await file.create(`${GUIDES_DIR}/epg.xml`, xml.create(output))
|
||||
}
|
||||
|
||||
async function generateCountries() {
|
||||
logger.info(`Generating countries/...`)
|
||||
|
||||
const countryCodes = ['US', 'ZA']
|
||||
|
||||
for (let code of countryCodes) {
|
||||
const output = {
|
||||
channels: [],
|
||||
programs: []
|
||||
}
|
||||
|
||||
output.channels = channels
|
||||
.filter(c => c.country === code)
|
||||
.map(c => {
|
||||
c.site = sources[c.id]
|
||||
return c
|
||||
})
|
||||
|
||||
for (let channel of output.channels) {
|
||||
output.programs = output.programs.concat(programs[channel.id])
|
||||
}
|
||||
|
||||
await file.create(`${GUIDES_DIR}/countries/${code.toLowerCase()}.epg.xml`, xml.create(output))
|
||||
}
|
||||
}
|
||||
|
||||
async function setUp() {
|
||||
channels = await loadChannels()
|
||||
programs = await loadPrograms()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue