Content deleted Content added
No edit summary
No edit summary
Line 122:
return result .. formattedGenres[#formattedGenres]
end
end
 
-- Function to format country flag using flagicon template
-- @param country string: The country code or name
-- @return string: Formatted country flag or empty string if country is nil or empty
local function formatCountryFlag(country)
if not country or country == "" then
return ""
end
return string.format('{{flagicon|%s}} ', country)
end
 
Line 192 ⟶ 203:
end
-- Handle channel URL and country flag
local channelUrl = ""
local channelDisplay = channel.name
local countryFlag = formatCountryFlag(channel.country)
if channel.channel and channel.channel ~= '' then
channelUrl = BASE_URL .. channel.channel .. URL_SUFFIX
channelDisplay = string.format('%s[%s %s]', countryFlag, channelUrl, channel.name)
end