Update update.js

This commit is contained in:
Aleksandr Statciuk 2022-10-06 14:13:50 +03:00
parent 0afc0a864a
commit 0b25372b13

View file

@ -32,11 +32,13 @@ async function main() {
channels = Object.values(channels) channels = Object.values(channels)
channels = _.sortBy(channels, 'id') channels = _.sortBy(channels, 'id')
const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml.gz` const gzFilepath = `${PUBLIC_DIR}/guides/${key}.epg.xml.gz`
logger.info(`Creating "${filepath}"...`) const jsonFilepath = `${PUBLIC_DIR}/guides/${key}.epg.json`
logger.info(`Creating "${gzFilepath}"...`)
const xmltv = generateXMLTV({ channels, programs, date: CURR_DATE }) const xmltv = generateXMLTV({ channels, programs, date: CURR_DATE })
const compressed = await zip.compress(xmltv) 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) { if (!total) {