diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-03-05 20:07:29 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-03-05 20:07:29 +0100 |
commit | eedb920807a5917ca63c6c8dd7c78e6e4bf2754e (patch) | |
tree | 172d4fc718ba7d1b7352e038d2d92d8c80884b01 /searchtimer_thread.c | |
parent | 0e3a3840e8daf19e2e8583cc2850a7b88bbf167a (diff) | |
download | vdr-plugin-epgsearch-eedb920807a5917ca63c6c8dd7c78e6e4bf2754e.tar.gz vdr-plugin-epgsearch-eedb920807a5917ca63c6c8dd7c78e6e4bf2754e.tar.bz2 |
0.9.24.beta22, %timer.modreason%, no mail when only eventid has changed
Diffstat (limited to 'searchtimer_thread.c')
-rw-r--r-- | searchtimer_thread.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/searchtimer_thread.c b/searchtimer_thread.c index e33e3cb..7cc02ba 100644 --- a/searchtimer_thread.c +++ b/searchtimer_thread.c @@ -40,6 +40,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #include "timerdone.h" #include "menu_deftimercheckmethod.h" #include "timerstatus.h" +#include "epgsearch.h" // priority for background thread #define SEARCHTIMER_NICE 19 @@ -273,6 +274,8 @@ void cSearchTimerThread::Action(void) cTimer *t = GetTimer(searchExt, pEvent, bTimesMatchExactly); char* Summary = NULL; + uint timerMod = tmNoChange; + if (t) { // already exists pOutdatedTimers->DelTimer(t); @@ -331,18 +334,30 @@ void cSearchTimerThread::Action(void) } else { - if (LogFile.Level() >= 3) // output reasons for a timer modification - { - if (!bTimesMatchExactly) - LogFile.Log(3,"timer for '%s~%s' (%s - %s, channel %d) : start/stop has changed", pEvent->Title()?pEvent->Title():"no title", pEvent->ShortText()?pEvent->ShortText():"no subtitle", GETDATESTRING(pEvent), GETTIMESTRING(pEvent), ChannelNrFromEvent(pEvent)); - if (strcmp(pFile, timer->File()) != 0) - LogFile.Log(3,"timer for '%s~%s' (%s - %s, channel %d) : title and/or episdode has changed", pEvent->Title()?pEvent->Title():"no title", pEvent->ShortText()?pEvent->ShortText():"no subtitle", GETDATESTRING(pEvent), GETTIMESTRING(pEvent), ChannelNrFromEvent(pEvent)); - if (t->Aux() != NULL && strcmp(t->Aux(), Summary) != 0) - LogFile.Log(3,"timer for '%s~%s' (%s - %s, channel %d) : aux info has changed", pEvent->Title()?pEvent->Title():"no title", pEvent->ShortText()?pEvent->ShortText():"no subtitle", GETDATESTRING(pEvent), GETTIMESTRING(pEvent), ChannelNrFromEvent(pEvent)); - } - index = t->Index()+1; - Priority = t->Priority(); - Lifetime = t->Lifetime(); + if (!bTimesMatchExactly) timerMod = (uint)timerMod | tmStartStop; + if (strcmp(pFile, timer->File()) != 0) timerMod |= tmFile; + if (t->Aux() != NULL && strcmp(t->Aux(), Summary) != 0) + { + char* oldEventID = GetAuxValue(t, "eventid"); + char* newEventID = GetAuxValue(Summary, "eventid"); + if (oldEventID && newEventID && strcmp(oldEventID, newEventID) != 0) + timerMod |= tmAuxEventID; + free(oldEventID); + free(newEventID); + } + + if (LogFile.Level() >= 3) // output reasons for a timer modification + { + if (timerMod & tmStartStop) + LogFile.Log(3,"timer for '%s~%s' (%s - %s, channel %d) : start/stop has changed", pEvent->Title()?pEvent->Title():"no title", pEvent->ShortText()?pEvent->ShortText():"no subtitle", GETDATESTRING(pEvent), GETTIMESTRING(pEvent), ChannelNrFromEvent(pEvent)); + if (timerMod & tmFile) + LogFile.Log(3,"timer for '%s~%s' (%s - %s, channel %d) : title and/or episdode has changed", pEvent->Title()?pEvent->Title():"no title", pEvent->ShortText()?pEvent->ShortText():"no subtitle", GETDATESTRING(pEvent), GETTIMESTRING(pEvent), ChannelNrFromEvent(pEvent)); + if (timerMod & tmAuxEventID) + LogFile.Log(3,"timer for '%s~%s' (%s - %s, channel %d) : aux info for event id has changed", pEvent->Title()?pEvent->Title():"no title", pEvent->ShortText()?pEvent->ShortText():"no subtitle", GETDATESTRING(pEvent), GETTIMESTRING(pEvent), ChannelNrFromEvent(pEvent)); + } + index = t->Index()+1; + Priority = t->Priority(); + Lifetime = t->Lifetime(); } free(pFile); @@ -400,7 +415,7 @@ void cSearchTimerThread::Action(void) continue; } - if (AddModTimer(timer, index, searchExt, pEvent, Priority, Lifetime, Summary)) + if (AddModTimer(timer, index, searchExt, pEvent, Priority, Lifetime, Summary, timerMod)) { if (index == 0) LogFile.Log(1,"added timer for '%s~%s' (%s - %s); search timer: '%s'", pEvent->Title(), pEvent->ShortText()?pEvent->ShortText():"", GETDATESTRING(pEvent), GETTIMESTRING(pEvent), searchExt->search); @@ -565,7 +580,7 @@ char* cSearchTimerThread::SummaryExtended(cSearchExt* searchExt, cTimer* Timer, return tmpSummary; } -bool cSearchTimerThread::AddModTimer(cTimer* Timer, int index, cSearchExt* searchExt, const cEvent* pEvent, int Prio, int Lifetime, char* Summary) +bool cSearchTimerThread::AddModTimer(cTimer* Timer, int index, cSearchExt* searchExt, const cEvent* pEvent, int Prio, int Lifetime, char* Summary, uint timerMod) { char *cmdbuf = NULL; @@ -651,7 +666,7 @@ bool cSearchTimerThread::AddModTimer(cTimer* Timer, int index, cSearchExt* searc if (index==0) // new mailNotifier.AddNewTimerNotification(pEvent->EventID(), pEvent->ChannelID()); else - mailNotifier.AddModTimerNotification(pEvent->EventID(), pEvent->ChannelID()); + mailNotifier.AddModTimerNotification(pEvent->EventID(), pEvent->ChannelID(), timerMod); } free(cmdbuf); if (tmpSummary) free(tmpSummary); |