Update update.js

This commit is contained in:
Aleksandr Statciuk 2022-07-06 17:32:45 +03:00
parent 80c7d1d3e2
commit e245003a81

View file

@ -25,11 +25,11 @@ async function main() {
if (channels[item.channel.id]) continue if (channels[item.channel.id]) continue
channels[item.channel.id] = new Channel(item.channel) 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 = Object.values(channels)
channels = _.sortBy(channels, 'id') 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` const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml`
logger.info(`Creating "${filepath}"...`) logger.info(`Creating "${filepath}"...`)