Skip to content

Commit

Permalink
Merge pull request #282 from vpeter4/leia-epg
Browse files Browse the repository at this point in the history
Speed up EPG loading
  • Loading branch information
phunkyfish authored Sep 23, 2019
2 parents a19d662 + e35acbd commit 27f7ca0
Show file tree
Hide file tree
Showing 3 changed files with 10 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="3.8.2"
version="3.8.3"
name="PVR IPTV Simple Client"
provider-name="nightik">
<requires>@ADDON_DEPENDS@</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 @@
v3.8.3
- Speed up EPG loading

v3.8.2
- Update github wiki link in addon.xml

Expand Down
9 changes: 6 additions & 3 deletions src/PVRIptvData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ bool PVRIptvData::LoadEPG(time_t iStart, time_t iEnd)
GetNodeValue(pChannelNode, "date", dateString);
if (!dateString.empty())
{
if (std::regex_match(dateString, std::regex("^[1-9][0-9][0-9][0-9][0-9][1-9][0-9][1-9]")))
static const std::regex dateRegex("^[1-9][0-9][0-9][0-9][0-9][1-9][0-9][1-9]");
if (std::regex_match(dateString, dateRegex))
entry.firstAired = static_cast<time_t>(ParseDateTime(dateString));

std::sscanf(dateString.c_str(), "%04d", &entry.iYear);
Expand Down Expand Up @@ -534,10 +535,12 @@ bool PVRIptvData::ParseXmltvNsEpisodeNumberInfo(const std::string& episodeNumber

bool PVRIptvData::ParseOnScreenEpisodeNumberInfo(const std::string& episodeNumberString, PVRIptvEpgEntry& entry)
{
const std::string text = std::regex_replace(episodeNumberString, std::regex("[ \\txX_\\.]"), "");
static const std::regex numRegex("[ \\txX_\\.]");
const std::string text = std::regex_replace(episodeNumberString, numRegex, "");

std::smatch match;
if (std::regex_match(text, match, std::regex("^[sS]([0-9][0-9]*)[eE][pP]?([0-9][0-9]*)$")))
static const std::regex epRegex("^[sS]([0-9][0-9]*)[eE][pP]?([0-9][0-9]*)$");
if (std::regex_match(text, match, epRegex))
{
if (match.size() == 3)
{
Expand Down

0 comments on commit 27f7ca0

Please sign in to comment.