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
c8cfb29b3c
commit
b2a93876ab
1 changed files with 20 additions and 15 deletions
|
@ -1,21 +1,26 @@
|
||||||
const file = require('./file')
|
const file = require('./file')
|
||||||
const parser = require('./parser')
|
const parser = require('./parser')
|
||||||
|
|
||||||
file.list('sites/*.channels.xml', ['sites/andorradifusio.ad.channels.xml']).then(files => {
|
file
|
||||||
const matrix = {
|
.list('sites/*.channels.xml', [
|
||||||
site: [],
|
'sites/andorradifusio.ad.channels.xml',
|
||||||
country: []
|
'sites/arianaafgtv.com.channels.xml'
|
||||||
}
|
])
|
||||||
|
.then(files => {
|
||||||
|
const matrix = {
|
||||||
|
site: [],
|
||||||
|
country: []
|
||||||
|
}
|
||||||
|
|
||||||
files.forEach(filename => {
|
files.forEach(filename => {
|
||||||
const channelsFile = file.read(filename)
|
const channelsFile = file.read(filename)
|
||||||
const parsed = parser.parseChannels(channelsFile)
|
const parsed = parser.parseChannels(channelsFile)
|
||||||
parsed.groups.forEach(group => {
|
parsed.groups.forEach(group => {
|
||||||
matrix.site.push(parsed.site)
|
matrix.site.push(parsed.site)
|
||||||
matrix.country.push(group.country.toLowerCase())
|
matrix.country.push(group.country.toLowerCase())
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
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