Skip to content

Commit

Permalink
Merge pull request #630 from phunkyfish/icon-encoding-url-arguments
Browse files Browse the repository at this point in the history
Support url arguments when encoding file portion of icon URL
  • Loading branch information
phunkyfish authored Aug 10, 2022
2 parents 2b62cf2 + dacc6a3 commit e455a2f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pvr.iptvsimple/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.iptvsimple"
version="20.5.0"
version="20.5.1"
name="IPTV Simple Client"
provider-name="nightik and Ross Nicholson">
<requires>@ADDON_DEPENDS@
Expand Down
3 changes: 3 additions & 0 deletions pvr.iptvsimple/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v20.5.1
- Support url arguments when encoding file portion of icon URL

v20.5.0
- URL encode last part of tvg logo URL as they can be based on channel names and they can contain spaces and non standard characters not allowed in paths

Expand Down
11 changes: 10 additions & 1 deletion src/iptvsimple/data/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,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 e455a2f

Please sign in to comment.