summaryrefslogtreecommitdiff
path: root/lib/searchtimer.h
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-03-05 14:51:57 +0100
committerhorchi <vdr@jwendel.de>2017-03-05 14:51:57 +0100
commit5eacf5bf36ddbac082a9e40a2bcdfd0f04fd3f9f (patch)
tree392875cb707b94aaba9d8941113eae35efaf2ec2 /lib/searchtimer.h
downloadvdr-plugin-epg2vdr-5eacf5bf36ddbac082a9e40a2bcdfd0f04fd3f9f.tar.gz
vdr-plugin-epg2vdr-5eacf5bf36ddbac082a9e40a2bcdfd0f04fd3f9f.tar.bz2
commit of actual revision1.1.441.1.42
Diffstat (limited to 'lib/searchtimer.h')
-rw-r--r--lib/searchtimer.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/lib/searchtimer.h b/lib/searchtimer.h
new file mode 100644
index 0000000..ecd3624
--- /dev/null
+++ b/lib/searchtimer.h
@@ -0,0 +1,86 @@
+/*
+ * searchtimer.h
+ *
+ * See the README file for copyright information
+ *
+ */
+
+#ifndef __SEARCHTIMER_H
+#define __SEARCHTIMER_H
+
+#include "common.h"
+#include "db.h"
+#include "epgservice.h"
+#include "json.h"
+
+class Python;
+
+//***************************************************************************
+// Search Timer
+//***************************************************************************
+
+class cSearchTimer
+{
+ public:
+
+ cSearchTimer();
+ ~cSearchTimer();
+
+ int init(const char* confDir);
+ int initDb();
+ int exitDb();
+
+ int modified(); // check if a search timer is modified by user
+ int updateSearchTimers(int force = yes, const char* reason = "");
+
+ int getSearchMatches(cDbRow* searchTimer, json_t* obj);
+ int getDoneFor(cDbRow* searchTimer, cDbRow* useevent, json_t* obj);
+ // int checkTimerConflicts(std::string& mailBody);
+ // int getUsedTransponderAt(time_t lStartTime, time_t lEndTime, std::string& mailBody);
+
+ int prepareDoneSelect(cDbRow* useeventsRow, int repeatfields, cDbStatement*& select);
+ cDbStatement* prepareSearchStatement(cDbRow* searchTimer, cDbTable* db);
+ int matchCriterias(cDbRow* searchTimer, cDbRow* event);
+
+ private:
+
+ int createTimer(int id);
+ int modifyCreateTimer(cDbRow* timerRow, int& newid);
+ // int rejectTimer(cDbRow* timerRow);
+
+ // data
+
+ Python* ptyRecName;
+
+ cDbConnection* connection;
+
+ cDbTable* searchtimerDb;
+ cDbTable* useeventsDb;
+ cDbTable* timersDoneDb;
+ cDbTable* timerDb;
+ cDbTable* mapDb;
+ cDbTable* vdrDb;
+
+ cDbStatement* selectChannelFromMap;
+ cDbStatement* selectDoneTimer;
+ cDbStatement* selectActiveSearchtimers;
+ cDbStatement* selectSearchtimerMaxModSp;
+ cDbStatement* selectActiveVdrs;
+ cDbStatement* selectAllTimer;
+ cDbStatement* selectTimerByEvent;
+ // cDbStatement* selectConflictingTimers;
+
+ cDbValue startValue;
+ cDbValue endValue;
+
+ time_t lastSearchTimerUpdate;
+
+ static int searchField[];
+ static const char* searchFieldName[];
+ static int repeadCheckField[];
+ static const char* repeadCheckFieldName[];
+
+};
+
+//***************************************************************************
+#endif // __SEARCHTIMER_H