mirror of
https://github.com/iptv-org/database.git
synced 2024-11-09 22:16:38 -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') {
|
||||
for (const [i, row] of rowsCopy.entries()) {
|
||||
fileErrors = fileErrors.concat(validateCountryLanguage(row, i))
|
||||
fileErrors = fileErrors.concat(validateCountryLanguages(row, i))
|
||||
}
|
||||
} else if (filename === 'subdivisions') {
|
||||
for (const [i, row] of rowsCopy.entries()) {
|
||||
|
@ -295,14 +295,16 @@ function validateChannel(row, i) {
|
|||
return errors
|
||||
}
|
||||
|
||||
function validateCountryLanguage(row, i) {
|
||||
function validateCountryLanguages(row, i) {
|
||||
const errors = []
|
||||
if (!db.languages[row.lang]) {
|
||||
for (let lang of row.languages) {
|
||||
if (!db.languages[lang]) {
|
||||
errors.push({
|
||||
line: i + 2,
|
||||
message: `"${row.code}" has the wrong language "${row.lang}"`
|
||||
message: `"${row.code}" has the wrong language "${lang}"`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return errors
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue