diff --git a/scripts/commands/create-database.js b/scripts/commands/create-database.js index 973e4059..a08ae368 100644 --- a/scripts/commands/create-database.js +++ b/scripts/commands/create-database.js @@ -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}` diff --git a/tests/commands/create-database.test.js b/tests/commands/create-database.test.js index 2e3c3402..3b39e67a 100644 --- a/tests/commands/create-database.test.js +++ b/tests/commands/create-database.test.js @@ -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 } ])