summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-12-02 08:25:40 +0100
committerhorchi <vdr@jwendel.de>2017-12-02 08:25:40 +0100
commit09433f627c19134c58263d63ed81e83d5c080a6f (patch)
tree50ea108397c518133c283042e96530595dd60f6b
parent894823c8b2b9382042d70df670966e8376b9138e (diff)
downloadvdr-epg-daemon-09433f627c19134c58263d63ed81e83d5c080a6f.tar.gz
vdr-epg-daemon-09433f627c19134c58263d63ed81e83d5c080a6f.tar.bz2
2017-12-02: version 1.1.123 (horchi)\n - added: Trigger osd2web plugins of running VDRs on new recording\n\n1.1.123
-rw-r--r--HISTORY.h16
-rw-r--r--epgd.h2
-rw-r--r--update.c56
-rw-r--r--webdo.c4
4 files changed, 44 insertions, 34 deletions
diff --git a/HISTORY.h b/HISTORY.h
index 53d980c..1f554d6 100644
--- a/HISTORY.h
+++ b/HISTORY.h
@@ -4,8 +4,8 @@
* -----------------------------------
*/
-#define _VERSION "1.1.122"
-#define VERSION_DATE "01.08.2017"
+#define _VERSION "1.1.123"
+#define VERSION_DATE "02.12.2017"
#define DB_API 4
#ifdef GIT_REV
@@ -17,17 +17,21 @@
/*
* ------------------------------------
*
+
+2017-12-02: version 1.1.123 (horchi)
+ - added: Trigger osd2web plugins of running VDRs on new recording
+
2017-10-09: version 1.1.122 (horchi)
- - change: Fixed curl SSL mode
+ - change: Fixed curl SSL mode
2017-08-01: version 1.1.121 (rechner)
- fixed: error, if no vdr available
-
+
2017-07-25: version 1.1.120 (rechner)
- added: show constable in eventdetail, if episodename is available
- - added: show constable extracol 1-3 in eventdetail
+ - added: show constable extracol 1-3 in eventdetail
- fixed: if recording view was reloaded the functionallity in bar was lost
-
+
2017-06-28: version 1.1.119 (rechner)
- added: Link to osd2web, if available
diff --git a/epgd.h b/epgd.h
index 46a0eaa..0e9f912 100644
--- a/epgd.h
+++ b/epgd.h
@@ -141,7 +141,7 @@ class cEpgd : public cFrame, public cSystemNotification
static int doShutDown() { return shutdown; }
int wakeupVdr(const char* uuid);
- int triggerVdrs(const char* trg, const char* options = "");
+ int triggerVdrs(const char* trg, const char* plug = 0, const char* options = 0);
int __attribute__ ((format(printf, 5, 6))) message(int level, char type, const char* title, const char* format, ...);
int sendTccMail(string& mailBody);
int sendTccTestMail();
diff --git a/update.c b/update.c
index 139f7c0..d02271d 100644
--- a/update.c
+++ b/update.c
@@ -798,8 +798,9 @@ int cEpgd::initDb()
selectActiveVdrs = new cDbStatement(vdrDb);
selectActiveVdrs->build("select ");
- selectActiveVdrs->bind("Ip", cDBS::bndOut);
- selectActiveVdrs->bind("Svdrp", cDBS::bndOut, ", ");
+ selectActiveVdrs->bind("IP", cDBS::bndOut);
+ selectActiveVdrs->bind("SVDRP", cDBS::bndOut, ", ");
+ selectActiveVdrs->bind("OSD2WEBP", cDBS::bndOut, ", ");
selectActiveVdrs->build(" from %s where state = 'attached' and svdrp > 0", vdrDb->TableName());
status += selectActiveVdrs->prepare();
@@ -1223,7 +1224,7 @@ void cEpgd::setState(Es::State state, time_t lastUpdate, int silent)
// inform clients about state change
actualState = state;
- triggerVdrs("STATE", Es::toName(actualState));
+ triggerVdrs("STATE", "epg2vdr", Es::toName(actualState));
if (actualState >= Es::esBusy && actualState <= Es::esBusyScraping)
sleep(2); // wait until vdrs detecting the busy state
@@ -1411,6 +1412,7 @@ void cEpgd::loop()
scrapNewRecordings(newRecCount.getIntValue());
setState(Es::esStandby, 0, no);
+ triggerVdrs("UPDREC", "osd2web");
}
countNewRecordings->freeResult();
@@ -1627,7 +1629,7 @@ int cEpgd::updateSearchTimers(int force, const char* reason)
searchTimerTrigger = no;
if (hits)
- triggerVdrs("TIMERJOB");
+ triggerVdrs("TIMERJOB", "epg2vdr");
// check 'not assumed' timers and wakeup VDR if necessary
@@ -2681,24 +2683,29 @@ bool cEpgd::checkRecOtherClients(string uuid, string recPath, int recStart)
return res;
}
-
//***************************************************************************
// Trigger VDRs
//***************************************************************************
-int cEpgd::triggerVdrs(const char* trg, const char* options)
+int cEpgd::triggerVdrs(const char* trg, const char* plug, const char* options)
{
- const char* plgs[] = { "epg2vdr", 0 };
+ // wait for dbInit ;)
- if (!selectActiveVdrs) // wait for dbInit ;)
+ if (!selectActiveVdrs)
return done;
vdrDb->clear();
for (int f = selectActiveVdrs->find(); f; f = selectActiveVdrs->fetch())
{
- const char* ip = vdrDb->getStrValue("Ip");
- unsigned int port = vdrDb->getIntValue("Svdrp");
+ const char* ip = vdrDb->getStrValue("IP");
+ unsigned int port = vdrDb->getIntValue("SVDRP");
+
+ if (strcmp(plug, "osd2web") == 0)
+ {
+ if (vdrDb->getIntValue("OSD2WEB") <= 0)
+ continue;
+ }
cSvdrpClient cl(ip, port);
@@ -2706,26 +2713,25 @@ int cEpgd::triggerVdrs(const char* trg, const char* options)
if (cl.open() == success)
{
- for (int i = 0; plgs[i]; i++)
- {
- char* command = 0;
- cList<cLine> result;
+ char* command = 0;
+ cList<cLine> result;
- asprintf(&command, "PLUG %s %s %s", plgs[i], trg, !isEmpty(options) ? options : "");
-
- tell(1, "Send '%s' to '%s' at '%s:%d'", command, plgs[i], ip, port);
+ if (!isEmpty(plug))
+ asprintf(&command, "PLUG %s %s %s", plug, trg, !isEmpty(options) ? options : "");
+ else
+ asprintf(&command, "%s %s", trg, !isEmpty(options) ? options : "");
- if (!cl.send(command))
- tell(0, "Error: Send '%s' to '%s' at '%s:%d' failed!",
- command, plgs[i], ip, port);
- else
- cl.receive(&result, 2);
+ tell(1, "Send '%s' to '%s:%d'", command,ip, port);
- free(command);
- }
+ if (!cl.send(command))
+ tell(0, "Error: Send '%s' to '%s:%d' failed!", command, ip, port);
+ else
+ cl.receive(&result, 2);
- cl.close(no);
+ free(command);
}
+
+ cl.close(no);
}
selectActiveVdrs->freeResult();
diff --git a/webdo.c b/webdo.c
index a2a3e94..679501e 100644
--- a/webdo.c
+++ b/webdo.c
@@ -190,8 +190,8 @@ int cEpgHttpd::doUpdateSearchtimer(MHD_Connection* tcp, json_t* obj)
int cEpgHttpd::doUpdateRecordingTable(MHD_Connection* tcp, json_t* obj)
{
- triggerVdrs("UPDR");
- triggerVdrs("UPDREC", "epg2vdr");
+ triggerVdrs("UPDR"); // trigger all vdrs re-read of the recordings directory
+ triggerVdrs("UPDREC", "epg2vdr"); // trigger epg2vdr tu update their data
return buildResponse(obj, MHD_HTTP_OK, "done");
}