mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Load logo from config
This commit is contained in:
parent
a03ea275c2
commit
89dd00e5f0
7 changed files with 37 additions and 21 deletions
|
@ -46,11 +46,13 @@ async function main() {
|
|||
}
|
||||
})
|
||||
|
||||
const programs = await grabber.grab(channel, config, (data, err) => {
|
||||
const programs = await grabber.grab(channel, config, async (data, err) => {
|
||||
await db.channels.update({ _id: channel._id }, { $set: { logo: data.channel.logo } })
|
||||
|
||||
logger.info(
|
||||
`[${i}/${total}] ${config.site} - ${data.channel.xmltv_id} - ${data.date.format(
|
||||
'MMM D, YYYY'
|
||||
)} (${data.programs.length} programs)`
|
||||
`[${i}/${total}] ${channel.site} - ${data.id} - ${data.date.format('MMM D, YYYY')} (${
|
||||
data.programs.length
|
||||
} programs)`
|
||||
)
|
||||
|
||||
if (err) logger.error(err.message)
|
||||
|
@ -62,7 +64,7 @@ async function main() {
|
|||
clusterLog,
|
||||
JSON.stringify({
|
||||
_id: channel._id,
|
||||
site: config.site,
|
||||
site: channel.site,
|
||||
country: channel.country,
|
||||
gid: channel.gid,
|
||||
programs
|
||||
|
@ -70,6 +72,8 @@ async function main() {
|
|||
)
|
||||
}
|
||||
|
||||
db.channels.compact()
|
||||
|
||||
logger.info(`Done in ${timer.format('HH[h] mm[m] ss[s]')}`)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue