diff options
author | Johann Friedrichs <johann.friedrichs@web.de> | 2018-03-26 13:22:37 +0200 |
---|---|---|
committer | Johann Friedrichs <johann.friedrichs@web.de> | 2018-03-26 13:22:37 +0200 |
commit | 5887e0a7d8ccaa626b559aac303e9e4d7a729769 (patch) | |
tree | 0665e8c8ecb5897021313e19f0eddbe8a7fba81f /conflictcheck.c | |
parent | e8a0e569152c50d6084f252d12854b8fd4e74466 (diff) | |
download | vdr-plugin-epgsearch-5887e0a7d8ccaa626b559aac303e9e4d7a729769.tar.gz vdr-plugin-epgsearch-5887e0a7d8ccaa626b559aac303e9e4d7a729769.tar.bz2 |
Fix remote conflict check
Diffstat (limited to 'conflictcheck.c')
-rw-r--r-- | conflictcheck.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/conflictcheck.c b/conflictcheck.c index 14ac636..14ab431 100644 --- a/conflictcheck.c +++ b/conflictcheck.c @@ -165,6 +165,12 @@ cConflictCheck::cConflictCheck() cConflictCheck::~cConflictCheck() { + if (failedList && (failedList != evaltimeList)) { + // if no local active timers but remote failed + // we have a new list + failedList->Clear(); + DELETENULL(failedList); + } if (evaltimeList) { evaltimeList->Clear(); DELETENULL(evaltimeList); @@ -218,16 +224,20 @@ void cConflictCheck::BondDevices(const char *Bondings) void cConflictCheck::Check() { + if (failedList && (failedList != evaltimeList)) + DELETENULL(failedList); if (evaltimeList) DELETENULL(evaltimeList); if (timerList) DELETENULL(timerList); + relevantConflicts = 0; + numConflicts = 0; LogFile.Log(3, "check only local conflicts = %s", GetLocal() ? "yes" : "no"); timerList = CreateCurrentTimerList(); if (timerList) evaltimeList = CreateEvaluationTimeList(timerList); if (evaltimeList) failedList = CreateConflictList(evaltimeList, timerList); - if ((!localConflicts) && timerList) CreateRemoteConflictList(timerList, failedList); + if ((!localConflicts) && timerList) failedList = CreateRemoteConflictList(timerList, failedList); if (failedList) for (cConflictCheckTime* checkTime = failedList->First(); checkTime; checkTime = failedList->Next(checkTime)) { LogFile.Log(2, "result of conflict check for %s:", DAYDATETIME(checkTime->evaltime)); @@ -382,8 +392,6 @@ cList<cConflictCheckTime>* cConflictCheck::CreateEvaluationTimeList(cList<cConfl cList<cConflictCheckTime>* cConflictCheck::CreateConflictList(cList<cConflictCheckTime>* EvalTimeList, cList<cConflictCheckTimerObj>* TimerList) { LogFile.Log(3, "create conflict list"); - relevantConflicts = 0; - numConflicts = 0; maxCheck = time(NULL) + std::min(14, EPGSearchConfig.checkMaxDays) * SECSINDAY; // check each time @@ -437,7 +445,7 @@ cList<cConflictCheckTime>* cConflictCheck::CreateConflictList(cList<cConflictChe return EvalTimeList; } -void cConflictCheck::CreateRemoteConflictList(cList<cConflictCheckTimerObj>* TimerList, cList<cConflictCheckTime>* failedList) +cList<cConflictCheckTime>* cConflictCheck::CreateRemoteConflictList(cList<cConflictCheckTimerObj>* TimerList, cList<cConflictCheckTime>* failedList) { LogFile.Log(3, "add remote conflicts to list"); bool foundRemote = false; @@ -457,7 +465,7 @@ void cConflictCheck::CreateRemoteConflictList(cList<cConflictCheckTimerObj>* Tim if (!foundRemote) { LogFile.Log(3, "no remote timers to add"); - return; + return failedList; } RemoteHosts.Sort(); @@ -547,6 +555,7 @@ void cConflictCheck::CreateRemoteConflictList(cList<cConflictCheckTimerObj>* Tim cConflictCheckThread::m_cacheTotalConflicts = numConflicts; cConflictCheckThread::m_cacheRelevantConflicts = relevantConflicts; LogFile.Log(3, "add remote conflicts done"); + return failedList; } // checks for conflicts at one special time |