Fixes missing channel logo issue

This commit is contained in:
Aleksandr Statciuk 2022-06-17 20:00:23 +03:00
parent ad9c5c9312
commit 588d5b73cf
3 changed files with 7 additions and 10 deletions

View file

@ -1,4 +1,4 @@
const { db, logger, file, api, zip } = require('../../core')
const { db, logger, file, zip } = require('../../core')
const { generateXMLTV, Program, Channel } = require('epg-grabber')
const _ = require('lodash')
@ -10,7 +10,6 @@ async function main() {
logger.info('Loading "database/programs.db"...')
await db.programs.load()
await api.channels.load()
let total = 0
const grouped = groupByGroup(await loadQueue())
@ -24,10 +23,7 @@ async function main() {
programs = programs.concat(itemPrograms)
if (channels[item.channel.id]) continue
const found = api.channels.find({ id: item.channel.id })
if (found) {
channels[item.channel.id] = new Channel(item.channel)
}
channels[item.channel.id] = new Channel(item.channel)
}
channels = Object.values(channels)
channels = _.sortBy(channels, 'id')