From e00776a0d8865f04e314a4219c6f478c8876921c Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Mon, 8 Aug 2022 16:33:53 +0100 Subject: [PATCH] Support url arguments when encoding file portion of icon URL --- src/iptvsimple/data/Channel.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/iptvsimple/data/Channel.cpp b/src/iptvsimple/data/Channel.cpp index 1cdddeb90..d5b8d15be 100644 --- a/src/iptvsimple/data/Channel.cpp +++ b/src/iptvsimple/data/Channel.cpp @@ -141,11 +141,20 @@ void Channel::SetIconPathFromTvgLogo(const std::string& tvgLogo, std::string& ch { const std::string urlPath = m_iconPath.substr(0, pos + 1); std::string urlFile = m_iconPath.substr(pos + 1); + + std::string urlArguments; + size_t argumentsPos = urlFile.find("?"); + if (argumentsPos != std::string::npos && argumentsPos > 0) + { + urlArguments = urlFile.substr(argumentsPos); + urlFile = urlFile.substr(0, argumentsPos - 1); + } + if (!utilities::WebUtils::IsEncoded(urlFile)) { urlFile = utilities::WebUtils::UrlEncode(urlFile); - m_iconPath = urlPath + urlFile; + m_iconPath = urlPath + urlFile + urlArguments; } } }