mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 10:56:57 -05:00
Update create-database.js
This commit is contained in:
@@ -38,7 +38,8 @@ async function getChannels() {
|
||||
const configPath = `${dir}/${site}.config.js`
|
||||
const config = require(file.resolve(configPath))
|
||||
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)
|
||||
for (const item of items) {
|
||||
const key = `${item.site}:${item.site_id}`
|
||||
|
||||
@@ -25,7 +25,7 @@ it('can create channels database', () => {
|
||||
site: 'example.com',
|
||||
channelsPath: 'tests/__data__/input/sites/example.com_ca-nl.channels.xml',
|
||||
configPath: 'tests/__data__/input/sites/example.com.config.js',
|
||||
groups: ['ca-nl'],
|
||||
groups: ['ca-nl/example.com'],
|
||||
cluster_id: 1
|
||||
}
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user