mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update create-database.js
This commit is contained in:
parent
15e54da0e2
commit
0d2458685b
2 changed files with 3 additions and 2 deletions
|
@ -38,7 +38,8 @@ async function getChannels() {
|
||||||
const configPath = `${dir}/${site}.config.js`
|
const configPath = `${dir}/${site}.config.js`
|
||||||
const config = require(file.resolve(configPath))
|
const config = require(file.resolve(configPath))
|
||||||
if (config.ignore) continue
|
if (config.ignore) continue
|
||||||
const [__, groupId] = filename.match(/_([a-z-]+)\.channels\.xml/i) || [null, null]
|
const [__, region] = filename.match(/_([a-z-]+)\.channels\.xml/i) || [null, null]
|
||||||
|
const groupId = `${region}/${site}`
|
||||||
const items = await parser.parseChannels(filepath)
|
const items = await parser.parseChannels(filepath)
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
const key = `${item.site}:${item.site_id}`
|
const key = `${item.site}:${item.site_id}`
|
||||||
|
|
|
@ -25,7 +25,7 @@ it('can create channels database', () => {
|
||||||
site: 'example.com',
|
site: 'example.com',
|
||||||
channelsPath: 'tests/__data__/input/sites/example.com_ca-nl.channels.xml',
|
channelsPath: 'tests/__data__/input/sites/example.com_ca-nl.channels.xml',
|
||||||
configPath: 'tests/__data__/input/sites/example.com.config.js',
|
configPath: 'tests/__data__/input/sites/example.com.config.js',
|
||||||
groups: ['ca-nl'],
|
groups: ['ca-nl/example.com'],
|
||||||
cluster_id: 1
|
cluster_id: 1
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue