Skip to content

Commit

Permalink
Merge pull request #555 from phunkyfish/fix-new-comparision
Browse files Browse the repository at this point in the history
Fix new comparision and don't set year for TV shows as it will usually be wrong
  • Loading branch information
phunkyfish authored Sep 11, 2021
2 parents b71d39e + 83597c4 commit 0d48960
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 5 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="7.6.11"
version="7.6.12"
name="PVR IPTV Simple Client"
provider-name="nightik and Ross Nicholson">
<requires>@ADDON_DEPENDS@
Expand All @@ -21,6 +21,10 @@
<icon>icon.png</icon>
</assets>
<news>
v7.6.12
- Fixed: Always compare to the raw start date and not the localised time to detect NEW programmes
- Fixed: Do not set year if this programme is a TV show

v7.6.11
- Fixed: EPG date entry only parsing year

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 @@
v7.6.12
- Fixed: Always compare to the raw start date and not the localised time to detect NEW programmes

v7.6.11
- Fixed: EPG date entry only parsing year

Expand Down
10 changes: 9 additions & 1 deletion src/iptvsimple/data/EpgEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ bool EpgEntry::UpdateFrom(const xml_node& channelNode, const std::string& id,
if (std::regex_match(dateString, dateRegex))
{
m_firstAired = ParseAsW3CDateString(dateString);
if (m_firstAired == ParseAsW3CDateString(m_startTime))
// Always compare to the raw string date value to avoid timezone issues
if (m_firstAired == ParseAsW3CDateString(strStart))
m_new = true;
}

Expand Down Expand Up @@ -255,8 +256,15 @@ bool EpgEntry::UpdateFrom(const xml_node& channelNode, const std::string& id,
}

if (!episodeNumbersList.empty())
{
ParseEpisodeNumberInfo(episodeNumbersList);

// If we don't have a season or episode number don't set the year as it's a TV show
// For TV show year usually represents the year of S01E01 which we don't have
if (m_episodeNumber != EPG_TAG_INVALID_SERIES_EPISODE || m_seasonNumber != EPG_TAG_INVALID_SERIES_EPISODE)
m_year = 0;
}

const auto& creditsNode = channelNode.child("credits");
if (creditsNode)
{
Expand Down

0 comments on commit 0d48960

Please sign in to comment.