mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update create-matrix.js
This commit is contained in:
parent
b6e5da0bcb
commit
faaa83c3ce
1 changed files with 2 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
||||||
const { Command } = require('commander')
|
const { Command } = require('commander')
|
||||||
const file = require('./file')
|
const file = require('./file')
|
||||||
const grabber = require('epg-grabber')
|
|
||||||
|
|
||||||
const program = new Command()
|
const program = new Command()
|
||||||
program
|
program
|
||||||
|
@ -16,14 +15,9 @@ file.list('sites/*/*.channels.xml', options.include, options.exclude).then(files
|
||||||
}
|
}
|
||||||
|
|
||||||
files.forEach(filename => {
|
files.forEach(filename => {
|
||||||
const country = filename.match(/sites\/.*\/.*_(.*)\.channels\.xml/i)[1]
|
const [_, site, country] = filename.match(/sites\/.*\/(.*)_(.*)\.channels\.xml/i)
|
||||||
|
|
||||||
const channelsFile = file.read(filename)
|
matrix.guide.push({ site, country })
|
||||||
const parsed = grabber.parseChannels(channelsFile)
|
|
||||||
matrix.guide.push({
|
|
||||||
site: parsed.site,
|
|
||||||
country
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue