diff options
author | horchi <vdr@jwendel.de> | 2018-01-27 16:45:29 +0100 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2018-01-27 16:45:29 +0100 |
commit | d4aab613d5efd6ee2c85c8c60ee1f97848057049 (patch) | |
tree | c782ef7349143069f1e8f4f94d60dbaa4cb747e5 | |
parent | df5ec6a1ce449679fd03ad59c4980c10cdd3eea3 (diff) | |
download | vdr-plugin-epg2vdr-d4aab613d5efd6ee2c85c8c60ee1f97848057049.tar.gz vdr-plugin-epg2vdr-d4aab613d5efd6ee2c85c8c60ee1f97848057049.tar.bz2 |
2018-01-27 version 1.1.80 (horchi)\n - added: Service to check if event has a timer\n\n1.1.80
-rw-r--r-- | HISTORY.h | 7 | ||||
-rw-r--r-- | epg2vdr.c | 34 | ||||
-rw-r--r-- | epg2vdr.h | 1 | ||||
-rw-r--r-- | service.h | 11 |
4 files changed, 50 insertions, 3 deletions
@@ -5,8 +5,8 @@ * */ -#define _VERSION "1.1.79" -#define VERSION_DATE "24.01.2018" +#define _VERSION "1.1.80" +#define VERSION_DATE "27.01.2018" #define DB_API 5 @@ -19,6 +19,9 @@ /* * ------------------------------------ +2018-01-27 version 1.1.80 (horchi) + - added: Service to check if event has a timer + 2018-01-24 version 1.1.79 (horchi) - change: minor changes, fixes and code cleanup @@ -869,7 +869,7 @@ bool cPluginEPG2VDR::Service(const char* id, void* data) return true; } - if (strcmp(id, EPG2VDR_TIMER_SERVICE) == 0 || strcmp(id, EPG2VDR_REC_DETAIL_SERVICE) == 0) + if (strcmp(id, EPG2VDR_TIMER_SERVICE) == 0 || strcmp(id, EPG2VDR_REC_DETAIL_SERVICE) == 0 || strcmp(id, EPG2VDR_HAS_TIMER) == 0) { // Services with direct db access @@ -884,6 +884,13 @@ bool cPluginEPG2VDR::Service(const char* id, void* data) if (ts) return timerService(ts); } + if (strcmp(id, EPG2VDR_HAS_TIMER) == 0) + { + cHas_Timer_V1* d = (cHas_Timer_V1*)data; + + if (d) + return hasTimerService(d); + } else if (strcmp(id, EPG2VDR_REC_DETAIL_SERVICE) == 0) { cEpgRecording_Details_Service_V1* rd = (cEpgRecording_Details_Service_V1*)data; @@ -900,6 +907,31 @@ bool cPluginEPG2VDR::Service(const char* id, void* data) } //*************************************************************************** +// Has Timer Service +//*************************************************************************** + +int cPluginEPG2VDR::hasTimerService(cHas_Timer_V1* d) +{ + cMutexLock lock(&mutexTimerService); + + timerDb->clear(); + vdrDb->clear(); + + d->hastimer = no; + + for (int f = selectTimers->find(); f && connection->check() == success; f = selectTimers->fetch()) + { + if (timerDb->hasValue("EVENTID", d->eventid)) + { + d->hastimer = yes; + break; + } + } + + return true; +} + +//*************************************************************************** // Timer Service //*************************************************************************** @@ -64,6 +64,7 @@ class cPluginEPG2VDR : public cPlugin int exitDb(); int timerService(cEpgTimer_Service_V1* ts); + int hasTimerService(cHas_Timer_V1* d); int recordingDetails(cEpgRecording_Details_Service_V1* rd); private: @@ -67,6 +67,16 @@ struct cEpgTimer_Service_V1 }; //*************************************************************************** +// Has Timer +//*************************************************************************** + +struct cHas_Timer_V1 +{ + long eventid; + int hastimer; +}; + +//*************************************************************************** // Recording Detail Service Interface //*************************************************************************** @@ -78,6 +88,7 @@ struct cEpgRecording_Details_Service_V1 #define EPG2VDR_TIMER_UPDATED "Epg2Vdr_Timer_Updated-v1.0" #define EPG2VDR_TIMER_SERVICE "Epg2Vdr_Timer_Service-v1.0" +#define EPG2VDR_HAS_TIMER "Epg2Vdr_Has_Timer_Service-v1.0" #define EPG2VDR_REC_DETAIL_SERVICE "Epg2Vdr_RecDetail_Service-v1.0" #ifdef EPG2VDR |