Skip to content

Commit

Permalink
Update reading XMLTV xmltv_ns for PVR API v9.0.0
Browse files Browse the repository at this point in the history
Update EpisodePartNumber with the total number of episodes in an episode sequence.  Use with Episode number
  • Loading branch information
emveepee committed Aug 22, 2024
1 parent eb7a1c1 commit d5a0f6d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 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="22.1.0"
version="22.2.0"
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 @@
v22.2.0
- Modify XMLTV xmltv_ns processing for v9.0.0 API

v22.1.0
- PVR Add-on API v9.0.0

Expand Down
10 changes: 8 additions & 2 deletions src/iptvsimple/data/EpgEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,19 @@ bool EpgEntry::ParseXmltvNsEpisodeNumberInfo(const std::string& episodeNumberStr

if (!episodePartString.empty())
{
int totalNumberOfParts;
int numElementsParsed = std::sscanf(episodePartString.c_str(), "%d/%d", &m_episodePartNumber, &totalNumberOfParts);
int numElementsParsed = std::sscanf(episodePartString.c_str(), "%d/%d", &m_episodeNumber, &m_episodePartNumber);

if (numElementsParsed == 2)
{
m_episodeNumber++;
m_episodePartNumber++;
}
else if (numElementsParsed == 1)
{
if (m_episodeNumber == EPG_TAG_INVALID_SERIES_EPISODE)
m_episodeNumber++;
m_episodePartNumber = EPG_TAG_INVALID_SERIES_EPISODE;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/iptvsimple/data/MediaEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void MediaEntry::UpdateTo(kodi::addon::PVRRecording& left, bool isInVirtualMedia
// left.SetStarRating(m_starRating);
left.SetSeriesNumber(m_seasonNumber);
left.SetEpisodeNumber(m_episodeNumber);
// left.SetEpisodePartNumber(m_episodePartNumber);
left.SetEpisodePartNumber(m_episodePartNumber);
left.SetEpisodeName(m_episodeName);
left.SetFirstAired(m_firstAired);
int iFlags = EPG_TAG_FLAG_UNDEFINED;
Expand Down

0 comments on commit d5a0f6d

Please sign in to comment.