From e245003a815c6f7d05b428ec5c07c330de8b4492 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 6 Jul 2022 17:32:45 +0300 Subject: [PATCH] Update update.js --- scripts/commands/guides/update.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index ab4ccde5..59e624a5 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -25,11 +25,11 @@ async function main() { if (channels[item.channel.id]) continue channels[item.channel.id] = new Channel(item.channel) } + programs = _.sortBy(programs, ['channel', 'start']) + programs = programs.map(p => new Program(p, channels[p.channel])) + total += programs.length channels = Object.values(channels) channels = _.sortBy(channels, 'id') - programs = _.sortBy(programs, ['channel', 'start']) - programs = programs.map(p => new Program(p)) - total += programs.length const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml` logger.info(`Creating "${filepath}"...`)