summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann Friedrichs <johann.friedrichs@web.de>2019-03-22 11:46:42 (GMT)
committerJohann Friedrichs <johann.friedrichs@web.de>2019-03-22 11:46:42 (GMT)
commitff17eae7a150b1420c3eebcf57ed2a407e9626a4 (patch)
tree6a05ec590f5fc5e567d0e6f5f9ff929459e25748
parent49ba796fe6298abf0ebba68a25ddfc92d3d70aad (diff)
downloadvdr-plugin-epgsearch-ff17eae7a150b1420c3eebcf57ed2a407e9626a4.tar.gz
vdr-plugin-epgsearch-ff17eae7a150b1420c3eebcf57ed2a407e9626a4.tar.bz2
Don't mix local and remote concurrent timers
Adjust nextRelevantConflictDate for remote conflicts Ignore remote conflicts in EpgsearchServiceHandler
-rw-r--r--conflictcheck.c6
-rw-r--r--services.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/conflictcheck.c b/conflictcheck.c
index d7dda8c..e90c474 100644
--- a/conflictcheck.c
+++ b/conflictcheck.c
@@ -496,6 +496,10 @@ cList<cConflictCheckTime>* cConflictCheck::CreateRemoteConflictList(cList<cConfl
failedList = new cList<cConflictCheckTime>;
LogFile.Log(2, "added remote checkTime %s to failedList", DAYDATETIME(evaltime));
failedList->Add(checkTime);
+ if (!nextRelevantConflictDate)
+ nextRelevantConflictDate = checkTime->evaltime;
+ else
+ nextRelevantConflictDate = std::min(nextRelevantConflictDate, checkTime->evaltime);
numConflicts++;
// find TimerObj with id Id in timerList
cConflictCheckTimerObj* failedTimer = NULL;
@@ -552,6 +556,7 @@ cList<cConflictCheckTime>* cConflictCheck::CreateRemoteConflictList(cList<cConfl
LogFile.Log(2, "ExecSVDRPCommand failed for %s", RemoteHosts[i]);
}
} // for all RemoteHosts
+ cConflictCheckThread::m_cacheNextConflict = nextRelevantConflictDate;
cConflictCheckThread::m_cacheTotalConflicts = numConflicts;
cConflictCheckThread::m_cacheRelevantConflicts = relevantConflicts;
LogFile.Log(3, "add remote conflicts done");
@@ -732,6 +737,7 @@ int cConflictCheck::GetDevice(cConflictCheckTimerObj* TimerObj, bool* NeedsDetac
void cConflictCheck::AddConflict(cConflictCheckTimerObj* TimerObj, cConflictCheckTime* CheckTime, std::set<cConflictCheckTimerObj*>& pendingTimers)
{
for (cConflictCheckTimerObj* concTimer = timerList->First(); concTimer; concTimer = timerList->Next(concTimer)) {
+ if (concTimer->timer->Remote()) continue; // ignore overlapping remote timers
if (concTimer->start >= TimerObj->stop) continue;
if (concTimer->stop <= TimerObj->start) continue;
if (!TimerObj->concurrentTimers) TimerObj->concurrentTimers = new std::set<cConflictCheckTimerObj*, TimerObjSort>;
diff --git a/services.c b/services.c
index 2013a38..31749f2 100644
--- a/services.c
+++ b/services.c
@@ -262,6 +262,7 @@ std::list<std::string> cEpgsearchServiceHandler::TimerConflictList(bool relOnly)
{
std::list<std::string> list;
cConflictCheck conflictCheck;
+ conflictCheck.SetLocal(); // remote Timers would give a wrong Id
conflictCheck.Check();
if ((relOnly && conflictCheck.numConflicts > 0) ||