Added support of tvg-language attribute

This commit is contained in:
freearhey
2019-10-30 20:19:54 +03:00
parent fc39bcebce
commit 3f0f9ae066
4 changed files with 29 additions and 11 deletions

View File

@ -1,5 +1,6 @@
const util = require('./util')
const escapeStringRegexp = require('escape-string-regexp')
const ISO6391 = require('iso-639-1')
const debug = false
const verbose = false
@ -121,6 +122,15 @@ async function main() {
}
}
if(!channel.language && c.name.length && c.name[0].lang) {
let language = ISO6391.getName(c.name[0].lang)
channel.language = language
updated = true
if(verbose) {
console.log(`Added language '${language}' to '${channel.id}'`)
}
}
if(!channel.logo && c.icon.length) {
const icon = c.icon[0].split('|')[0]
channel.logo = icon