diff options
author | Christian Wieninger <cwieninger@gmx.de> | 2011-05-28 15:02:17 +0200 |
---|---|---|
committer | Christian Wieninger <cwieninger@gmx.de> | 2011-05-28 15:02:17 +0200 |
commit | d71b080637c5eba84854f2338b53fdda8fc6ed34 (patch) | |
tree | 3efefac4793302cc85b89c5eb08c72814a0960a9 | |
parent | 280c12c3c7042e176c6acc3bd7718f66cd9eb39d (diff) | |
download | vdr-plugin-epgsearch-d71b080637c5eba84854f2338b53fdda8fc6ed34.tar.gz vdr-plugin-epgsearch-d71b080637c5eba84854f2338b53fdda8fc6ed34.tar.bz2 |
new setup variable epgsearch.ConflCheckCmd
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | HISTORY.DE | 2 | ||||
-rw-r--r-- | conflictcheck.c | 36 | ||||
-rw-r--r-- | conflictcheck.h | 1 | ||||
-rw-r--r-- | conflictcheck_thread.c | 4 | ||||
-rw-r--r-- | doc-src/en/epgsearch.4.txt | 13 | ||||
-rw-r--r-- | epgsearch.c | 2 | ||||
-rw-r--r-- | epgsearchcfg.c | 1 | ||||
-rw-r--r-- | epgsearchcfg.h | 1 | ||||
-rw-r--r-- | searchtimer_thread.c | 2 |
10 files changed, 62 insertions, 2 deletions
@@ -3,6 +3,8 @@ VDR Plugin 'epgsearch' Revision History 2010-xx-xx; Version 0.9.25 new: +- new setup variable epgsearch.ConflCheckCmd (no gui for this, so edit setup.conf!), that + allows executing a command for each timer causing a conflict, see the MANUAL for details. - vdr-1.7.15 has changed the SVDRP default port to 6419, please update this in epgsearch's setup menu too! - support for vdr-1.7.12 and later @@ -3,6 +3,8 @@ VDR Plugin 'epgsearch' Revision History 2010-xx-xx; Version 0.9.25 neu: +- neue Setup-Option epgsearch.ConflCheckCmd (keine GUI dazu, also nur per setup.conf zu + setzen!), mit der man je Konflikt-Timer einen Befehl ausführen kann, mehr dazu im MANUAL. - vdr-1.7.15 benutzt einen anderen SVDRP Standard-Port (6419), bitte im Setupmenü von epgsearch ebenfalls anpassen! - Unterstützung für vdr-1.7.12 und später diff --git a/conflictcheck.c b/conflictcheck.c index 4d1538d..ce25612 100644 --- a/conflictcheck.c +++ b/conflictcheck.c @@ -29,6 +29,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #include "conflictcheck_thread.h" #include "recstatus.h" #include "timerstatus.h" +#include "uservars.h" #define FULLMATCH 1000 #define EPGLIMITBEFORE (1 * 3600) // Time in seconds before a timer's start time and @@ -681,3 +682,38 @@ bool cConflictCheck::TimerInConflict(cTimer* timer) } return false; } + +void cConflictCheck::EvaluateConflCheckCmd() +{ + if (strlen(EPGSearchConfig.conflCheckCmd) > 0) + { + LogFile.Log(2,"evaluating conflict check command '%s'", EPGSearchConfig.conflCheckCmd); + for(cConflictCheckTime* ct = failedList->First(); ct; ct = failedList->Next(ct)) + { + if (ct->ignore) continue; + std::set<cConflictCheckTimerObj*,TimerObjSort>::iterator it; + for (it = ct->failedTimers.begin(); it != ct->failedTimers.end(); it++) + if ((*it) && !(*it)->ignore) + { + string result = EPGSearchConfig.conflCheckCmd; + if (!(*it)->OrigTimer()) + { + LogFile.Log(3,"timer has disappeared meanwhile"); + continue; + } + else + LogFile.Log(3,"evaluating conflict check command for timer '%s' (%s, channel %s)", (*it)->timer->File(), DAYDATETIME((*it)->start), CHANNELNAME((*it)->timer->Channel())); + + if ((*it)->Event()) + { + cVarExpr varExprEvent(result); + result = varExprEvent.Evaluate((*it)->Event()); + } + cVarExpr varExprTimer(result); + result = varExprTimer.Evaluate((*it)->timer); + cVarExpr varExpr(result); + varExpr.Evaluate(); + } + } + } +} diff --git a/conflictcheck.h b/conflictcheck.h index 13a08f8..545da8b 100644 --- a/conflictcheck.h +++ b/conflictcheck.h @@ -307,6 +307,7 @@ class cConflictCheck void AddConflict(cConflictCheckTimerObj* TimerObj, cConflictCheckTime* Checktime, std::set<cConflictCheckTimerObj*>& pendingTimers); int ProcessCheckTime(cConflictCheckTime* checkTime); bool TimerInConflict(cTimer*); + void EvaluateConflCheckCmd(); }; #endif diff --git a/conflictcheck_thread.c b/conflictcheck_thread.c index 466e031..d5c9cdb 100644 --- a/conflictcheck_thread.c +++ b/conflictcheck_thread.c @@ -132,8 +132,8 @@ void cConflictCheckThread::Action(void) cMailConflictNotifier mailNotifier; mailNotifier.SendConflictNotifications(conflictCheck); } - } - + conflictCheck.EvaluateConflCheckCmd(); + } // store for external access cConflictCheckThread::m_cacheNextConflict = conflictCheck.nextRelevantConflictDate; cConflictCheckThread::m_cacheRelevantConflicts = conflictCheck.relevantConflicts; diff --git a/doc-src/en/epgsearch.4.txt b/doc-src/en/epgsearch.4.txt index dd0db6b..6257499 100644 --- a/doc-src/en/epgsearch.4.txt +++ b/doc-src/en/epgsearch.4.txt @@ -647,6 +647,19 @@ timer (like modifying start/stop or deleting a timer) in the conflict details menu also cause an immediate return to the overview menu and produce an update. +Note: +There's a 'hidden' setup option epgsearch.ConflCheckCmd, that allows executing a +command for each timer causing a conflict. You have to set this directly in VDRs +setup.conf like this: + +epgsearch.ConflCheckCmd = system(your_script_handling_the_conflict.sh, any_arguments like %timer.file%) + +(Please have a look at 'Calling a system command' below for the possible arguments) +One could use this for example to forward a timer to another VDR machine in case of a conflict. +This command is evaluated for each timer causing a conflict whenever an automatic +conflict check is running. When calling the conflict check via OSD the command is not +evaluated. + =head1 12. User defined variables You can create your own variables to be used in any place that supports diff --git a/epgsearch.c b/epgsearch.c index 20643c4..8a27505 100644 --- a/epgsearch.c +++ b/epgsearch.c @@ -641,6 +641,8 @@ bool cPluginEpgsearch::SetupParse(const char *Name, const char *Value) if (!strcasecmp(Name, "CheckConflictsMinDuration")) EPGSearchConfig.checkMinDuration = atoi(Value); if (!strcasecmp(Name, "CheckConflictsAfterTimerProg")) EPGSearchConfig.checkTimerConflAfterTimerProg = atoi(Value); if (!strcasecmp(Name, "CheckConflictsOnRecording")) EPGSearchConfig.checkTimerConflOnRecording = atoi(Value); + if (!strcasecmp(Name, "ConflCheckCmd")) strcpy(EPGSearchConfig.conflCheckCmd, Value); + if (!strcasecmp(Name, "NoConflMsgWhileReplay")) EPGSearchConfig.noConflMsgWhileReplay = atoi(Value); if (!strcasecmp(Name, "NoAnnounceWhileReplay")) EPGSearchConfig.noAnnounceWhileReplay = atoi(Value); if (!strcasecmp(Name, "TimerProgRepeat")) EPGSearchConfig.TimerProgRepeat = atoi(Value); diff --git a/epgsearchcfg.c b/epgsearchcfg.c index 2ef4558..ff45aaa 100644 --- a/epgsearchcfg.c +++ b/epgsearchcfg.c @@ -92,6 +92,7 @@ cEPGSearchConfig::cEPGSearchConfig(void) checkEPGWarnByOSD = 1; checkEPGWarnByMail = 0; checkEPGchannelGroupNr = -1; + strcpy(conflCheckCmd, ""); } int cShowMode::Compare(const cListObject &ListObject) const diff --git a/epgsearchcfg.h b/epgsearchcfg.h index 8ed73a7..d2d163b 100644 --- a/epgsearchcfg.h +++ b/epgsearchcfg.h @@ -147,6 +147,7 @@ cEPGSearchConfig(void); int checkEPGWarnByMail; int checkEPGchannelGroupNr; time_t lastMailOnSearchtimerAt; + char conflCheckCmd[MaxFileName*10]; }; extern cEPGSearchConfig EPGSearchConfig; diff --git a/searchtimer_thread.c b/searchtimer_thread.c index 73ee80e..4f3f3ad 100644 --- a/searchtimer_thread.c +++ b/searchtimer_thread.c @@ -546,6 +546,8 @@ void cSearchTimerThread::Action(void) mailNotifier.SendConflictNotifications(conflictCheck); } + conflictCheck.EvaluateConflCheckCmd(); + cString msgfmt = cString::sprintf(tr("%d timer conflict(s)! First at %s. Show them?"), conflictCheck.relevantConflicts, *DateTime(conflictCheck.nextRelevantConflictDate)); |