Skip to content

Commit

Permalink
Support url arguments when encoding file portion of icon URL
Browse files Browse the repository at this point in the history
  • Loading branch information
phunkyfish committed Aug 10, 2022
1 parent 6447c58 commit e00776a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/iptvsimple/data/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit e00776a

Please sign in to comment.