mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update core/api.js
This commit is contained in:
parent
e293add009
commit
146079dc90
8 changed files with 1926 additions and 7 deletions
|
@ -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`
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue