mirror of
https://github.com/iptv-org/database.git
synced 2024-11-22 02:44:10 -05:00
Update validate.js
This commit is contained in:
parent
1f4212f030
commit
a3c980d7fd
1 changed files with 9 additions and 7 deletions
|
@ -91,7 +91,7 @@ async function main() {
|
||||||
}
|
}
|
||||||
} else if (filename === 'countries') {
|
} else if (filename === 'countries') {
|
||||||
for (const [i, row] of rowsCopy.entries()) {
|
for (const [i, row] of rowsCopy.entries()) {
|
||||||
fileErrors = fileErrors.concat(validateCountryLanguage(row, i))
|
fileErrors = fileErrors.concat(validateCountryLanguages(row, i))
|
||||||
}
|
}
|
||||||
} else if (filename === 'subdivisions') {
|
} else if (filename === 'subdivisions') {
|
||||||
for (const [i, row] of rowsCopy.entries()) {
|
for (const [i, row] of rowsCopy.entries()) {
|
||||||
|
@ -295,14 +295,16 @@ function validateChannel(row, i) {
|
||||||
return errors
|
return errors
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateCountryLanguage(row, i) {
|
function validateCountryLanguages(row, i) {
|
||||||
const errors = []
|
const errors = []
|
||||||
if (!db.languages[row.lang]) {
|
for (let lang of row.languages) {
|
||||||
|
if (!db.languages[lang]) {
|
||||||
errors.push({
|
errors.push({
|
||||||
line: i + 2,
|
line: i + 2,
|
||||||
message: `"${row.code}" has the wrong language "${row.lang}"`
|
message: `"${row.code}" has the wrong language "${lang}"`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue