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
d15e2abbe4
commit
df3bb4014d
1 changed files with 22 additions and 5 deletions
|
@ -1,9 +1,26 @@
|
||||||
const file = require('./file.js')
|
const file = require('./file')
|
||||||
|
const parser = require('./parser')
|
||||||
|
|
||||||
|
const days = 2
|
||||||
|
const includes = []
|
||||||
|
|
||||||
|
file.list('sites/*.channels.xml', includes).then(files => {
|
||||||
|
const matrix = {
|
||||||
|
site: [],
|
||||||
|
country: [],
|
||||||
|
days: []
|
||||||
|
}
|
||||||
|
|
||||||
|
files.forEach(filename => {
|
||||||
|
const channelsFile = file.read(filename)
|
||||||
|
const parsed = parser.parseChannels(channelsFile)
|
||||||
|
parsed.groups.forEach(group => {
|
||||||
|
matrix.site.push(parsed.site)
|
||||||
|
matrix.country.push(group.country)
|
||||||
|
matrix.days.push(days)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
file.list('channels/**/*.xml', ['ad'], ['us-local']).then(files => {
|
|
||||||
const country = files.map(file => file.replace(/channels\/|\.xml/gi, ''))
|
|
||||||
const days = country.map(() => 2)
|
|
||||||
const matrix = { country, days }
|
|
||||||
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
||||||
console.log(output)
|
console.log(output)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue