From f581df2b6d5d29dcaf4e392c504edcec42a51746 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 9 Feb 2023 13:40:24 +0300 Subject: [PATCH] Update update.js --- scripts/commands/guides/update.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index f31e7cf8..f4ee10f9 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -26,7 +26,7 @@ async function main() { logger.info('loading database/queue.db...') await db.queue.load() db_queue = await db.queue.find({}) - logger.info(`found ${db_queue.length} channels`) + logger.info(`found ${db_queue.length} items`) logger.info('loading database/programs.db...') await db.programs.load() @@ -44,7 +44,8 @@ async function main() { main() async function generate() { - let queue = _.groupBy(db_queue, i => (i.channel ? `${i.channel.lang}/${i.channel.site}` : `_`)) + let queue = _.uniqBy(db_queue, i => i.channel.lang + i.channel.id + i.channel.site) + queue = _.groupBy(queue, i => (i.channel ? `${i.channel.lang}/${i.channel.site}` : `_`)) delete queue['_'] let programs = _.groupBy(db_programs, p =>