Update save-results.js

This commit is contained in:
Aleksandr Statciuk 2022-01-19 02:41:56 +03:00
parent 13c133b329
commit fd71f35c0e
2 changed files with 16 additions and 6 deletions

View file

@ -16,11 +16,21 @@ async function main() {
await db.channels.update({ _id: result._id }, { $set: { logo: result.logo } })
const programs = result.programs.map(program => {
program.site = result.site
program.country = result.country
program.gid = result.gid
return program
return {
title: program.title,
description: program.description || null,
category: program.category || [],
season: program.season || null,
episode: program.episode || null,
icon: program.icon || null,
channel: program.channel,
lang: program.lang,
start: program.start,
stop: program.stop,
site: result.site,
country: result.country,
gid: result.gid
}
})
await db.programs.insert(programs)