Skip to content

Commit e455a2f

Browse files
authored
Merge pull request #630 from phunkyfish/icon-encoding-url-arguments
Support url arguments when encoding file portion of icon URL
2 parents 2b62cf2 + dacc6a3 commit e455a2f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

pvr.iptvsimple/addon.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<addon
33
id="pvr.iptvsimple"
4-
version="20.5.0"
4+
version="20.5.1"
55
name="IPTV Simple Client"
66
provider-name="nightik and Ross Nicholson">
77
<requires>@ADDON_DEPENDS@

pvr.iptvsimple/changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v20.5.1
2+
- Support url arguments when encoding file portion of icon URL
3+
14
v20.5.0
25
- 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
36

src/iptvsimple/data/Channel.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,20 @@ void Channel::SetIconPathFromTvgLogo(const std::string& tvgLogo, std::string& ch
144144
{
145145
const std::string urlPath = m_iconPath.substr(0, pos + 1);
146146
std::string urlFile = m_iconPath.substr(pos + 1);
147+
148+
std::string urlArguments;
149+
size_t argumentsPos = urlFile.find("?");
150+
if (argumentsPos != std::string::npos && argumentsPos > 0)
151+
{
152+
urlArguments = urlFile.substr(argumentsPos);
153+
urlFile = urlFile.substr(0, argumentsPos - 1);
154+
}
155+
147156
if (!utilities::WebUtils::IsEncoded(urlFile))
148157
{
149158
urlFile = utilities::WebUtils::UrlEncode(urlFile);
150159

151-
m_iconPath = urlPath + urlFile;
160+
m_iconPath = urlPath + urlFile + urlArguments;
152161
}
153162
}
154163
}

0 commit comments

Comments
 (0)