Update format.js

This commit is contained in:
Aleksandr Statciuk 2021-10-23 06:25:53 +03:00
parent 80ce577313
commit 7888841f17

View File

@ -237,8 +237,13 @@ function updateLogo(channel, data, epgData) {
}
function updateTvgLanguage(channel, data) {
if (!channel.tvg.language && data) {
channel.tvg.language = data.languages.map(l => l.name).join(';')
if (!channel.tvg.language) {
if (data) {
channel.tvg.language = data.languages.map(l => l.name).join(';')
} else if (channel.countries.length) {
const countryCode = channel.countries[0].code
channel.tvg.language = utils.country2language(countryCode)
}
}
}