From 0b25372b13bc0638e0407b1372fe1d8cbfac2c69 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 6 Oct 2022 14:13:50 +0300 Subject: [PATCH] Update update.js --- scripts/commands/guides/update.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index fa9425e8..300e00d7 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -32,11 +32,13 @@ async function main() { channels = Object.values(channels) channels = _.sortBy(channels, 'id') - const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml.gz` - logger.info(`Creating "${filepath}"...`) + const gzFilepath = `${PUBLIC_DIR}/guides/${key}.epg.xml.gz` + const jsonFilepath = `${PUBLIC_DIR}/guides/${key}.epg.json` + logger.info(`Creating "${gzFilepath}"...`) const xmltv = generateXMLTV({ channels, programs, date: CURR_DATE }) const compressed = await zip.compress(xmltv) - await file.create(filepath, compressed) + await file.create(gzFilepath, compressed) + await file.create(jsonFilepath, JSON.stringify({ channels, programs })) } if (!total) {