From 7888841f17c8a9fd68c2cced2fdc44aab896afd2 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 23 Oct 2021 06:25:53 +0300 Subject: [PATCH] Update format.js --- scripts/format.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/format.js b/scripts/format.js index 08e12fe387..5d6ddf66c9 100644 --- a/scripts/format.js +++ b/scripts/format.js @@ -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) + } } }