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
df51fe3d45
commit
3d0d891ef5
2 changed files with 5 additions and 4 deletions
|
@ -36,15 +36,16 @@ async function generateMainXML() {
|
||||||
async function generateCountries() {
|
async function generateCountries() {
|
||||||
logger.info(`Generating countries/...`)
|
logger.info(`Generating countries/...`)
|
||||||
|
|
||||||
const countryCodes = Object.keys(programs).map(id => channels[id].country)
|
const filteredChannels = Object.keys(programs).map(id => channels[id])
|
||||||
|
|
||||||
for (let code of countryCodes) {
|
for (let channel of filteredChannels) {
|
||||||
|
const code = channel.country
|
||||||
const output = {
|
const output = {
|
||||||
channels: [],
|
channels: [],
|
||||||
programs: []
|
programs: []
|
||||||
}
|
}
|
||||||
|
|
||||||
output.channels = _.flatten(Object.values(channels))
|
output.channels = filteredChannels
|
||||||
.filter(c => c.country === code)
|
.filter(c => c.country === code)
|
||||||
.map(c => {
|
.map(c => {
|
||||||
c.site = sources[c.id]
|
c.site = sources[c.id]
|
||||||
|
|
|
@ -32,7 +32,7 @@ it('can generate epg.xml', () => {
|
||||||
expect(output).toBe(expected)
|
expect(output).toBe(expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
fit('can generate /countries guides', () => {
|
it('can generate /countries guides', () => {
|
||||||
const output1 = content('tests/__data__/output/guides/countries/us.epg.xml')
|
const output1 = content('tests/__data__/output/guides/countries/us.epg.xml')
|
||||||
const expected1 = content('tests/__data__/expected/guides/countries/us.epg.xml')
|
const expected1 = content('tests/__data__/expected/guides/countries/us.epg.xml')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue