Update core/api.js

This commit is contained in:
Aleksandr Statciuk 2022-01-30 05:50:38 +03:00
parent e293add009
commit 146079dc90
8 changed files with 1926 additions and 7 deletions

View file

@ -2,7 +2,6 @@ const { db, logger, file, api } = require('../core')
const grabber = require('epg-grabber')
const _ = require('lodash')
const DB_DIR = process.env.DB_DIR || 'scripts/database'
const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs'
const PUBLIC_DIR = process.env.PUBLIC_DIR || '.gh-pages'
const LOG_PATH = `${LOGS_DIR}/update-guides.log`
@ -21,6 +20,7 @@ async function generateGuides() {
logger.info('Loading "database/programs.db"...')
await db.programs.load()
await api.channels.load()
for (const key in grouped) {
const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml`

View file

@ -10,6 +10,8 @@ const options = program
.opts()
async function main() {
await api.countries.load()
await api.subdivisions.load()
const records = await getLogRecords()
await generateCountriesTable(records)
await generateUSStatesTable(records)