Merge branch 'master' into fix-deploy

This commit is contained in:
Aleksandr Statciuk 2022-01-19 21:46:28 +03:00
commit 3bf8e54dae
18 changed files with 149 additions and 212 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)

View file

@ -50,6 +50,8 @@ async function loadPrograms() {
title: item.title,
desc: item.description || null,
categories: item.category || [],
season: item.season || null,
episode: item.episode || null,
image: item.icon || null,
start: item.start,
stop: item.stop

View file

@ -1,4 +1,5 @@
const { db, logger, file, xml } = require('../core')
const { db, logger, file } = require('../core')
const grabber = require('epg-grabber')
const _ = require('lodash')
const DB_DIR = process.env.DB_DIR || 'scripts/database'
@ -32,7 +33,7 @@ async function generateGuides() {
}
)
const output = xml.create({ channels: groupChannels, programs: groupProgs })
const output = grabber.convertToXMLTV({ channels: groupChannels, programs: groupProgs })
logger.info(`Creating "${filepath}"...`)
await file.create(filepath, output)
@ -67,9 +68,9 @@ async function loadPrograms() {
programs = programs.map(program => {
return {
title: program.title ? [{ lang: program.lang, value: program.title }] : [],
description: program.description ? [{ lang: program.lang, value: program.description }] : [],
categories: program.category ? [{ lang: program.lang, value: program.category }] : [],
title: program.title,
description: program.description,
categories: program.category,
icon: program.icon,
channel: program.channel,
lang: program.lang,
@ -77,6 +78,8 @@ async function loadPrograms() {
stop: program.stop,
site: program.site,
country: program.country,
season: program.season,
episode: program.episode,
gid: program.gid,
_id: program._id
}