diff --git a/scripts/commands/programs/save.js b/scripts/commands/programs/save.js index bbad2fdf..41b9e2f0 100644 --- a/scripts/commands/programs/save.js +++ b/scripts/commands/programs/save.js @@ -1,5 +1,5 @@ const { db, logger, file, parser } = require('../../core') -const { Program } = require('epg-grabber') +const { Program, Channel } = require('epg-grabber') const _ = require('lodash') const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' @@ -16,8 +16,9 @@ async function main() { const queue = await db.queue.find({ _id: result._qid }).limit(1) if (!queue.length) continue const item = queue[0] + const c = new Channel(item.channel) const programs = result.programs.map(p => { - p = new Program(p) + p = new Program(p, c) p._qid = result._qid return p