From d466a071e5d3aa52f91e89e1a71243846f4538e6 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 1 Dec 2023 20:11:28 +0300 Subject: [PATCH] Update queueCreator.ts --- scripts/core/queueCreator.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/core/queueCreator.ts b/scripts/core/queueCreator.ts index 5e56bce3..993c378c 100644 --- a/scripts/core/queueCreator.ts +++ b/scripts/core/queueCreator.ts @@ -36,18 +36,22 @@ export class QueueCreator { const queue = new Queue() for (const channel of this.parsedChannels.all()) { - if (!channel.site || !channel.xmltv_id) continue + if (!channel.site || !channel.site_id || !channel.name) continue if (this.options.lang && channel.lang !== this.options.lang) continue const configPath = path.resolve(SITES_DIR, `${channel.site}/${channel.site}.config.js`) const config: SiteConfig = await this.configLoader.load(configPath) - const found: ApiChannel = channels.first( - (_channel: ApiChannel) => _channel.id === channel.xmltv_id - ) - if (found) { - channel.logo = found.logo - channel.name = found.name + if (channel.xmltv_id) { + const found: ApiChannel = channels.first( + (_channel: ApiChannel) => _channel.id === channel.xmltv_id + ) + if (found) { + channel.logo = found.logo + channel.name = found.name + } + } else { + channel.xmltv_id = channel.site_id } const days = this.options.days || config.days || 1