mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update save-results.js
This commit is contained in:
parent
99efb08046
commit
b493c5ec1e
2 changed files with 29 additions and 27 deletions
|
@ -12,9 +12,9 @@ async function main() {
|
|||
logger.info(`Parsing "${filepath}"...`)
|
||||
const results = await parser.parseLogs(filepath)
|
||||
for (const result of results) {
|
||||
const channels = await db.queue.find({ _id: result._qid }).limit(1)
|
||||
if (!channels.length) continue
|
||||
const channel = channels[0]
|
||||
const queue = await db.queue.find({ _id: result._qid }).limit(1)
|
||||
if (!queue.length) continue
|
||||
const item = queue[0]
|
||||
const programs = result.programs.map(program => {
|
||||
return {
|
||||
title: program.title,
|
||||
|
@ -23,10 +23,12 @@ async function main() {
|
|||
season: program.season || null,
|
||||
episode: program.episode || null,
|
||||
icon: program.icon || null,
|
||||
channel: channel.xmltv_id,
|
||||
channel: item.xmltv_id,
|
||||
lang: program.lang,
|
||||
start: program.start,
|
||||
stop: program.stop,
|
||||
stop: program.stop,
|
||||
site: item.site,
|
||||
_qid: result._qid
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue