Skip to content

Commit

Permalink
Merge pull request #105 from excorp/Krypton
Browse files Browse the repository at this point in the history
Krypton
  • Loading branch information
Jalle19 authored Feb 1, 2017
2 parents ac82606 + bc29f62 commit 8f725fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 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="2.4.9"
version="2.4.10"
name="PVR IPTV Simple Client"
provider-name="nightik">
<requires>
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 @@
v2.4.10
- added Channel number tvg-chno to m3u

v2.4.9
- Fix: Change the line lenght to 4k.

Expand Down
14 changes: 12 additions & 2 deletions src/PVRIptvData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#define TVG_INFO_NAME_MARKER "tvg-name="
#define TVG_INFO_LOGO_MARKER "tvg-logo="
#define TVG_INFO_SHIFT_MARKER "tvg-shift="
#define TVG_INFO_CHNO_MARKER "tvg-chno="
#define GROUP_NAME_MARKER "group-title="
#define RADIO_MARKER "radio="
#define CHANNEL_LOGO_EXTENSION ".png"
Expand Down Expand Up @@ -366,6 +367,7 @@ bool PVRIptvData::LoadPlayList(void)
{
bool bRadio = false;
double fTvgShift = 0;
std::string strChnlNo = "";
std::string strChnlName = "";
std::string strTvgId = "";
std::string strTvgName = "";
Expand All @@ -391,6 +393,7 @@ bool PVRIptvData::LoadPlayList(void)
strTvgId = ReadMarkerValue(strInfoLine, TVG_INFO_ID_MARKER);
strTvgName = ReadMarkerValue(strInfoLine, TVG_INFO_NAME_MARKER);
strTvgLogo = ReadMarkerValue(strInfoLine, TVG_INFO_LOGO_MARKER);
strChnlNo = ReadMarkerValue(strInfoLine, TVG_INFO_CHNO_MARKER);
strGroupName = ReadMarkerValue(strInfoLine, GROUP_NAME_MARKER);
strRadio = ReadMarkerValue(strInfoLine, RADIO_MARKER);
strTvgShift = ReadMarkerValue(strInfoLine, TVG_INFO_SHIFT_MARKER);
Expand All @@ -407,6 +410,11 @@ bool PVRIptvData::LoadPlayList(void)
}
fTvgShift = atof(strTvgShift.c_str());

if (!strChnlNo.empty())
{
iChannelNum = atoi(strChnlNo.c_str());
}

bRadio = !StringUtils::CompareNoCase(strRadio, "true");
tmpChannel.strTvgId = strTvgId;
tmpChannel.strTvgName = XBMC->UnknownToUTF8(strTvgName.c_str());
Expand Down Expand Up @@ -449,7 +457,7 @@ bool PVRIptvData::LoadPlayList(void)

PVRIptvChannel channel;
channel.iUniqueId = GetChannelId(tmpChannel.strChannelName.c_str(), strLine.c_str());
channel.iChannelNumber = iChannelNum++;
channel.iChannelNumber = iChannelNum;
channel.strTvgId = tmpChannel.strTvgId;
channel.strChannelName = tmpChannel.strChannelName;
channel.strTvgName = tmpChannel.strTvgName;
Expand All @@ -459,7 +467,9 @@ bool PVRIptvData::LoadPlayList(void)
channel.strStreamURL = strLine;
channel.iEncryptionSystem = 0;

if (iCurrentGroupId > 0)
iChannelNum++;

if (iCurrentGroupId > 0)
{
channel.bRadio = m_groups.at(iCurrentGroupId - 1).bRadio;
m_groups.at(iCurrentGroupId - 1).members.push_back(iChannelIndex);
Expand Down

0 comments on commit 8f725fa

Please sign in to comment.