From d4aab613d5efd6ee2c85c8c60ee1f97848057049 Mon Sep 17 00:00:00 2001 From: horchi Date: Sat, 27 Jan 2018 16:45:29 +0100 Subject: 2018-01-27 version 1.1.80 (horchi)\n - added: Service to check if event has a timer\n\n --- epg2vdr.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'epg2vdr.c') diff --git a/epg2vdr.c b/epg2vdr.c index 96ea846..f56ccb3 100644 --- a/epg2vdr.c +++ b/epg2vdr.c @@ -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; @@ -899,6 +906,31 @@ bool cPluginEPG2VDR::Service(const char* id, void* data) return false; } +//*************************************************************************** +// 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 //*************************************************************************** -- cgit v1.2.3