Upgrade epg-grabber package

This commit is contained in:
freearhey 2023-11-25 11:54:48 +03:00
parent 83c80cec52
commit 13fc52132d
4 changed files with 27 additions and 27 deletions

View file

@ -19,6 +19,7 @@ export class Grabber {
this.logger = logger
this.queue = queue
this.options = options
this.grabber = process.env.NODE_ENV === 'test' ? new EPGGrabberMock() : new EPGGrabber()
}
async grab(): Promise<{ channels: Collection; programs: Collection }> {
@ -48,11 +49,10 @@ export class Grabber {
config.delay = delay
}
const grabber =
process.env.NODE_ENV === 'test' ? new EPGGrabberMock(config) : new EPGGrabber(config)
const _programs = await grabber.grab(
const _programs = await this.grabber.grab(
channel,
date,
config,
(data: GrabCallbackData, error: Error | null) => {
const { programs, date } = data