summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2018-01-27 16:45:29 +0100
committerhorchi <vdr@jwendel.de>2018-01-27 16:45:29 +0100
commitd4aab613d5efd6ee2c85c8c60ee1f97848057049 (patch)
treec782ef7349143069f1e8f4f94d60dbaa4cb747e5
parentdf5ec6a1ce449679fd03ad59c4980c10cdd3eea3 (diff)
downloadvdr-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.h7
-rw-r--r--epg2vdr.c34
-rw-r--r--epg2vdr.h1
-rw-r--r--service.h11
4 files changed, 50 insertions, 3 deletions
diff --git a/HISTORY.h b/HISTORY.h
index cd79cf0..fedb0f7 100644
--- a/HISTORY.h
+++ b/HISTORY.h
@@ -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
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;
@@ -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
//***************************************************************************
diff --git a/epg2vdr.h b/epg2vdr.h
index a34376a..26ab2bd 100644
--- a/epg2vdr.h
+++ b/epg2vdr.h
@@ -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:
diff --git a/service.h b/service.h
index ffe4072..729f559 100644
--- a/service.h
+++ b/service.h
@@ -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