From 2c972d2666b879bea23b4670c6ec88b64539a14b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 12 Nov 2022 01:22:15 +0300 Subject: [PATCH] Update validate.js --- scripts/commands/channels/validate.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/commands/channels/validate.js b/scripts/commands/channels/validate.js index 98cdf6bb..6edf454c 100644 --- a/scripts/commands/channels/validate.js +++ b/scripts/commands/channels/validate.js @@ -1,6 +1,7 @@ const { parser, logger, api } = require('../../core') const { program } = require('commander') const chalk = require('chalk') +const langs = require('langs') program.argument('', 'Path to file to validate').parse(process.argv) @@ -43,6 +44,11 @@ async function main() { errors.push({ type: 'wrong_xmltv_id', xmltv_id: channel.id, ...channel }) stats.errors++ } + + if (!langs.where('1', channel.lang)) { + errors.push({ type: 'wrong_lang', xmltv_id: channel.id, ...channel }) + stats.errors++ + } } if (errors.length) {