Skip to content

Commit

Permalink
Merge pull request #884 from emveepee/episodepart
Browse files Browse the repository at this point in the history
Update reading XMLTV xmltv_ns for PVR API v9.0.0
  • Loading branch information
phunkyfish authored Aug 24, 2024
2 parents eb7a1c1 + 412cb25 commit 19f7304
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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 19f7304

Please sign in to comment.