From 0811d57aec9f58c793952be1f0b97458c2be018c Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 27 Oct 2021 02:58:10 +0300 Subject: [PATCH] Update format.js --- scripts/format.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/format.js b/scripts/format.js index d89e6a48ce..c66f4cd0d6 100644 --- a/scripts/format.js +++ b/scripts/format.js @@ -228,9 +228,9 @@ function updateTvgCountry(channel) { function updateLogo(channel, data, epgData) { if (!channel.logo) { - if (data) { + if (data && data.logo) { channel.logo = data.logo - } else if (epgData) { + } else if (epgData && epgData.logo) { channel.logo = epgData.logo } } @@ -238,7 +238,7 @@ function updateLogo(channel, data, epgData) { function updateTvgLanguage(channel, data) { if (!channel.tvg.language) { - if (data) { + if (data && data.languages.length) { channel.tvg.language = data.languages.map(l => l.name).join(';') } else if (channel.countries.length) { const countryCode = channel.countries[0].code @@ -248,8 +248,12 @@ function updateTvgLanguage(channel, data) { } function updateGroupTitle(channel, data) { - if (!channel.group.title && data) { - channel.group.title = channel.category || data.category || '' + if (!channel.group.title) { + if (channel.category) { + channel.group.title = channel.category + } else if (data && data.category) { + channel.group.title = data.category + } } }