From 781e093d465d39c954be8489a6945002f3b83d22 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 15 Oct 2021 00:58:42 +0300 Subject: [PATCH] Update create-matrix.js --- scripts/create-matrix.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/create-matrix.js b/scripts/create-matrix.js index fa4e989e..3cad96ac 100644 --- a/scripts/create-matrix.js +++ b/scripts/create-matrix.js @@ -1,6 +1,6 @@ const { Command } = require('commander') const file = require('./file') -const parser = require('./parser') +const grabber = require('epg-grabber') const program = new Command() program @@ -16,13 +16,13 @@ file.list('sites/*.channels.xml', options.include, options.exclude).then(files = } files.forEach(filename => { + const country = filename.match(/sites\/.*_(.*)\.channels\.xml/i)[1] + const channelsFile = file.read(filename) - const parsed = parser.parseChannels(channelsFile) - parsed.groups.forEach(group => { - matrix.guide.push({ - site: parsed.site, - country: group.country.toLowerCase() - }) + const parsed = grabber.parseChannels(channelsFile) + matrix.guide.push({ + site: parsed.site, + country }) })