mirror of
https://github.com/iptv-org/database.git
synced 2024-12-25 17:04:33 -05:00
Update validate.js
This commit is contained in:
parent
b893c10765
commit
6087a6c06a
1 changed files with 15 additions and 0 deletions
|
@ -53,6 +53,21 @@ async function main() {
|
|||
}
|
||||
|
||||
fileErrors = fileErrors.concat(findDuplicatesById(data))
|
||||
} else if (filename === 'blocklist') {
|
||||
let channels = await csv.fromFile('data/channels.csv').catch(err => {
|
||||
logger.error(chalk.red(`\nError: ${err.message}`))
|
||||
process.exit(1)
|
||||
})
|
||||
channels = channels.map(c => c.id)
|
||||
|
||||
data.forEach((row, i) => {
|
||||
if (channels.length && !channels.includes(row.channel)) {
|
||||
fileErrors.push({
|
||||
line: i + 2,
|
||||
message: `"${row.channel}" is missing in the channels.csv`
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const schema = Joi.object(schemes[filename])
|
||||
|
|
Loading…
Reference in a new issue