Update validate.js

This commit is contained in:
Aleksandr Statciuk 2022-11-12 01:22:15 +03:00
parent 2afe3ff92d
commit 2c972d2666

View file

@ -1,6 +1,7 @@
const { parser, logger, api } = require('../../core')
const { program } = require('commander')
const chalk = require('chalk')
const langs = require('langs')
program.argument('<filepath>', '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) {