Skip to content

Commit

Permalink
Merge pull request #631 from phunkyfish/icon-encoding-url-arguments-m…
Browse files Browse the repository at this point in the history
…atrix

Support url arguments when encoding file portion of icon URL - Matrix
  • Loading branch information
phunkyfish authored Aug 10, 2022
2 parents 6447c58 + 644bcec commit 83727fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 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="19.2.0"
version="19.2.1"
name="PVR IPTV Simple Client"
provider-name="nightik and Ross Nicholson">
<requires>@ADDON_DEPENDS@
Expand All @@ -21,6 +21,9 @@
<icon>icon.png</icon>
</assets>
<news>
v19.2.1
- Support url arguments when encoding file portion of icon URL

v19.2.0
- URL encode last part of tvg logo URL as they can be based on channel names

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 @@
v19.2.1
- Support url arguments when encoding file portion of icon URL

v19.2.0
- URL encode last part of tvg logo URL as they can be based on channel names

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 @@ -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 83727fb

Please sign in to comment.