From 80c02a6c4fc33a044e2420c345e5db570d8bb26b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 15:02:46 +0300 Subject: [PATCH] Update update.js --- scripts/commands/guides/update.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index e4c9d797..c1f203c5 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -47,9 +47,6 @@ async function main() { .filter(Boolean) logger.info(`found ${db_programs.length} programs`) - logger.info(`creating ${logPath}...`) - await file.create(logPath) - await generateByCountry() await generateBySource() @@ -231,9 +228,10 @@ function calcScore(program) { async function makeReport() { const errors = [] + let countryGuides = guides.filter(g => g.groupedBy === 'country') let programs = _.uniqBy(db_programs, p => p.site + p.channel) for (let program of programs) { - if (!guides.find(g => g.channel === program.channel)) { + if (!countryGuides.find(g => g.channel === program.channel)) { const channel = await api.channels.find({ id: program.channel }) errors.push({ type: 'no_guide', ...program, ...channel }) }