Update validate.ts

This commit is contained in:
freearhey 2023-11-20 08:56:11 +03:00
parent 81f52d5bcc
commit fd58996a15
1 changed files with 14 additions and 1 deletions

View File

@ -59,11 +59,24 @@ async function main() {
totalErrors++ 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 }) errors.push({ type: 'wrong_xmltv_id', ...channel })
totalErrors++ 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)) { if (!langs.where('1', channel.lang)) {
errors.push({ type: 'wrong_lang', ...channel }) errors.push({ type: 'wrong_lang', ...channel })
totalErrors++ totalErrors++