Skip to content

Commit

Permalink
5.0.3 Timer changes (#132)
Browse files Browse the repository at this point in the history
Start and end times not being set correctly on any time type 1 and 2.    Set the original time on timeslot recording.
  • Loading branch information
emveepee committed Jun 9, 2020
1 parent 4575cbe commit efede1f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pvr.nextpvr/addon.xml.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.nextpvr"
version="5.0.2"
version="5.0.3"
name="NextPVR PVR Client"
provider-name="Graeme Blackley">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
5 changes: 5 additions & 0 deletions pvr.nextpvr/changelog.txt
@@ -1,3 +1,8 @@
v5.0.3
- Recording types 1 and 2 should start/end anytime
- Set start and end time on timeslot recordings
- Indicate disabled timers

v5.0.2
- Open most streams with the proper READ_NO_CACHE value
- Move MenuHook to one time call, avoid issue OnWake
Expand Down
36 changes: 23 additions & 13 deletions src/Timers.cpp
Expand Up @@ -96,21 +96,25 @@ PVR_ERROR Timers::GetTimers(ADDON_HANDLE& handle)

tag.iTimerType = pRulesNode->FirstChildElement("EPGTitle") ? TIMER_REPEATING_EPG : TIMER_REPEATING_MANUAL;

std::string buffer;

// start/end time

std::string buffer;
if (XMLUtils::GetString(pRulesNode, "StartTimeTicks", buffer))
const int recordingType = g_pvrclient->XmlGetUInt(pRecurringNode, "type");

if (recordingType == 1 || recordingType == 2)
{
tag.startTime = stoll(buffer);
if (tag.startTime < time(nullptr))
{
tag.startTime = 0;
}
else
{
if (XMLUtils::GetString(pRulesNode, "EndTimeTicks", buffer))
tag.endTime = stoll(buffer);
}
tag.startTime = 0;
tag.endTime = 0;
tag.bStartAnyTime = true;
tag.bEndAnyTime = true;
}
else
{
if (XMLUtils::GetString(pRulesNode, "StartTimeTicks", buffer))
tag.startTime = stoll(buffer);
if (XMLUtils::GetString(pRulesNode, "EndTimeTicks", buffer))
tag.endTime = stoll(buffer);
}

// keyword recordings
Expand Down Expand Up @@ -197,7 +201,13 @@ PVR_ERROR Timers::GetTimers(ADDON_HANDLE& handle)
XMLUtils::GetString(pRecurringNode, "name", buffer);
buffer.copy(tag.strTitle, sizeof(tag.strTitle) - 1);

tag.state = PVR_TIMER_STATE_SCHEDULED;
bool state = true;
XMLUtils::GetBoolean(pRulesNode, "enabled", state);

if (state == false)
tag.state = PVR_TIMER_STATE_DISABLED;
else
tag.state = PVR_TIMER_STATE_SCHEDULED;

strcpy(tag.strSummary, "summary");

Expand Down

0 comments on commit efede1f

Please sign in to comment.