mirror of
https://github.com/iptv-org/database.git
synced 2024-11-13 23:32:31 -05:00
Update validate.js
This commit is contained in:
parent
f92d80b236
commit
9f925606bd
1 changed files with 13 additions and 0 deletions
|
@ -68,6 +68,7 @@ async function main() {
|
||||||
fileErrors = fileErrors.concat(await validateChannelCategories(row, i))
|
fileErrors = fileErrors.concat(await validateChannelCategories(row, i))
|
||||||
fileErrors = fileErrors.concat(await validateChannelLanguages(row, i))
|
fileErrors = fileErrors.concat(await validateChannelLanguages(row, i))
|
||||||
fileErrors = fileErrors.concat(await validateChannelCountry(row, i))
|
fileErrors = fileErrors.concat(await validateChannelCountry(row, i))
|
||||||
|
fileErrors = fileErrors.concat(await validateChannelSubdivision(row, i))
|
||||||
}
|
}
|
||||||
} else if (filename === 'blocklist') {
|
} else if (filename === 'blocklist') {
|
||||||
for (const [i, row] of rows.entries()) {
|
for (const [i, row] of rows.entries()) {
|
||||||
|
@ -147,6 +148,18 @@ async function validateChannelCountry(row, i) {
|
||||||
return errors
|
return errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function validateChannelSubdivision(row, i) {
|
||||||
|
const errors = []
|
||||||
|
if (row.subdivision && !db.subdivisions[row.subdivision]) {
|
||||||
|
errors.push({
|
||||||
|
line: i + 2,
|
||||||
|
message: `"${row.id}" has the wrong subdivision "${row.subdivision}"`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return errors
|
||||||
|
}
|
||||||
|
|
||||||
async function validateChannelLanguages(row, i) {
|
async function validateChannelLanguages(row, i) {
|
||||||
const errors = []
|
const errors = []
|
||||||
row.languages.forEach(language => {
|
row.languages.forEach(language => {
|
||||||
|
|
Loading…
Reference in a new issue