From fd58996a15cb6261ddea38faace1882d3774d2ab Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 20 Nov 2023 08:56:11 +0300 Subject: [PATCH] Update validate.ts --- scripts/commands/channels/validate.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/commands/channels/validate.ts b/scripts/commands/channels/validate.ts index 0bf2d6d4..acaece8b 100644 --- a/scripts/commands/channels/validate.ts +++ b/scripts/commands/channels/validate.ts @@ -59,11 +59,24 @@ async function main() { totalErrors++ } - if (channels.missing((_channel: ApiChannel) => _channel.id === channel.xmltv_id)) { + const foundChannel = channels.first( + (_channel: ApiChannel) => _channel.id === channel.xmltv_id + ) + if (!foundChannel) { errors.push({ type: 'wrong_xmltv_id', ...channel }) totalErrors++ } + // if (foundChannel && foundChannel.replacedBy) { + // errors.push({ type: 'replaced', ...channel }) + // totalErrors++ + // } + + // if (foundChannel && foundChannel.closed && !foundChannel.replacedBy) { + // errors.push({ type: 'closed', ...channel }) + // totalErrors++ + // } + if (!langs.where('1', channel.lang)) { errors.push({ type: 'wrong_lang', ...channel }) totalErrors++