[vdr-plugin-epgsync] 02/04: Imported Upstream version 1.0.1

Tobias Grimm tiber-guest at moszumanska.debian.org
Tue Nov 4 21:25:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to branch master
in repository vdr-plugin-epgsync.

commit e8ed482672c4dc334f45af53d1604d63700cb7c1
Author: etobi <git at e-tobi.net>
Date:   Tue Nov 4 22:20:59 2014 +0100

    Imported Upstream version 1.0.1
---
 HISTORY     |   4 +++
 README      | 100 +++++++++++++++++++++++++++++++++++++++---------------------
 epgsync.c   |  23 ++++++++++++--
 po/de_DE.po |   5 ++-
 po/it_IT.po |   5 ++-
 po/sk_SK.po |   5 ++-
 setup.c     |   6 ++++
 setup.h     |   1 +
 thread.c    |   4 +++
 thread.h    |   3 ++
 10 files changed, 117 insertions(+), 39 deletions(-)

diff --git a/HISTORY b/HISTORY
index 1473ada..7cb243a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,10 @@
 VDR Plugin 'epgsync' Revision History
 -----------------------------------------
 
+- Updated Slovak translation (thanks to Milan Hrala)
+- New option for periodic sync (suggested by GTRDRIVER at vdrportal)
+- Added SVDRP command to trigger sync (suggested by no sleep at vdrportal)
+
 2013-06-07: Version 1.0.0
 
 - Updated Makefile for VDR 1.7.36 and dropped compatibility with older VDR
diff --git a/README b/README
index 084cc02..e21048d 100644
--- a/README
+++ b/README
@@ -32,7 +32,7 @@ Since svdrpservice-0.0.4 you can already specify the server IP and port
 on the commandline. It will then serve as the default for all plugins
 using svdrpservice:
 
-  -P remoteosd -P 'svdrpservice 192.0.2.1:6419'
+  -P epgsync -P 'svdrpservice 192.0.2.1:6419'
 
 Check the svdrphosts.conf (or streamdevhosts.conf) file on the remote
 VDR: The IP of the VDR running epgsync must be listed or otherwise the
@@ -40,39 +40,66 @@ connection will be refused.
 
 Configuration:
 --------------
-Before you can connect you have to configure the IP address of the
-remote VDR. So you have to enter the plugin's setup menu first. It
-offers the following options:
-
-- Hide mainmenu entry: The mainmenu entry of epgsync allows you to
-trigger an epgsync at any time. If you don't need this or if you are
-using a keymakro to call the mainmenu entry you can hide it with this
-option.
-- Server IP: Enter the IP of the remote VDR
-- Server port: Since VDR 1.7.15 the default port is 6419, before it
-was 2001. If you prefer VTP, its default port is 2004. The default
-value 0 uses the port configured in svdrpservice.
-- Connection attempts: Defines how often epgsync will try to establish
-the connection to the server. For most users the default 1 should be
-sufficient. However if e.g. the client uses WOL to wake the server it
-might not be available immediately. The first retry will be after 1
-second. The delay will be doubled after each attempt.
-- Update "now" and "next" first: Enable this option if you want to
-import the "What's on now/next" entries first. It uses the SVDRP
-commands "LSTE now" and "LSTE next". Especially useful for those who
-start with an empty epg.data file.
-- Sync channel by channel: Determines how the EPG is downloaded. See
-notes below.
-- EPG sync on startup: Start syncing when the plugin is started.
-- Map channels by: mode "ID", the default, simply copies the EPG data
-it receives, effectively mapping channels by their channel ID. In
-"ID, Name" mode, if no local channel corresponds to a channel ID from
-EPG, an attempt is made to find the channel by name. Finally in
-"Name, ID" mode, epgsync searches for a channel by name, prefering
-channels with a different ID. You can use this mode to copy EPG to
-analogue channels. Note: When looking up a channel by name, case is
-ignored. Both, the long and the short channel names are considered.
-- Target channels: Restrict the EPG import to certain channel types.
+Before you can connect, your local VDR must know the IP address of the
+remote VDR. Either configure a default IP in the svdrpservice plugin or
+enter it in epgsync's setup.
+
+The plugin setup offers the following options:
+
+- Hide mainmenu entry
+The mainmenu entry of epgsync allows you to trigger an epgsync at any
+time. If you don't need this or if you are using a keymakro to call the
+mainmenu entry you can hide it with this option.
+
+- Server IP
+P address of SVDRP server. Leave empty or enter "0.0.0.0" if you want
+to use the default IP configured in the svdrpservice plugin.
+
+- Server port
+SVDRP port on server. Since VDR 1.7.15 the default port is 6419, before
+it was 2001. If you prefer VTP, its default port is 2004. The special
+value 0 uses the default port configured in svdrpservice.
+
+- Connection attempts
+Defines how often epgsync will try to establish the connection to the
+server. For most users the default 1 should be sufficient. However if
+e.g. the client uses WOL to wake the server it might not be available
+immediately. The first retry will be after 1 second. The delay will be
+doubled after each attempt.
+
+- Update "now" and "next" first
+Enable this option if you want to import the "What's on now/next"
+entries first. It uses the SVDRP commands "LSTE now" and "LSTE next".
+Especially useful for those who start with an empty epg.data file.
+
+- Sync channel by channel
+Determines how the EPG is downloaded. See notes below.
+
+- EPG sync on startup
+Start syncing when the plugin is started.
+
+- EPG sync timeout (h)
+Perform an epgsync regularely when enabled.  You will need this option
+only in special cases. As long as your client syncs on startup
+regularely and receives EPG information via DVB stream (e.g. using
+streamdev's "Filter Streaming" option) you should be fine without this
+option. This is not an exact timeout but a minimum delay in hours
+between two syncs. Every successful manually or SVDRP triggered sync
+will reset the timeout. This setting won't trigger a sync right after
+plugin start. Use the previous option instead.
+
+- Map channels by
+Mode "ID", the default, simply copies the EPG data it receives,
+effectively mapping channels by their channel ID. In "ID, Name" mode,
+if no local channel corresponds to a channel ID from EPG, an attempt
+is made to find the channel by name. Finally in "Name, ID" mode,
+epgsync searches for a channel by name, prefering channels with a
+different ID. You can use this mode to copy EPG to analogue channels.
+Note: When looking up a channel by name, case is ignored. Both, the
+long and the short channel names are considered.
+
+- Target channels
+Restrict the EPG import to certain channel types.
 
 Recommended settings
 --------------------
@@ -122,3 +149,8 @@ to get the remote channel list. For each channel in this list, epgsync
 sends an "LSTE <channel number>", processes the reply and sleeps for a few
 millis. So in the end epgsync imports the EPG of all remote channels. It
 is not necessary to enable "Update now and next first".
+
+SVDRP
+-----
+You can trigger an EPG sync with the following SVDRP command:
+  PLUG epgsync SYNC
diff --git a/epgsync.c b/epgsync.c
index ae68ead..e61d911 100644
--- a/epgsync.c
+++ b/epgsync.c
@@ -11,7 +11,7 @@
 #include "setup.h"
 #include "thread.h"
 
-static const char *VERSION        = "1.0.0";
+static const char *VERSION        = "1.0.1";
 static const char *DESCRIPTION    = trNOOP("Import EPG of an other VDR");
 static const char *MAINMENUENTRY  = trNOOP("Synchronize EPG");
 
@@ -91,6 +91,11 @@ void cPluginEpgsync::Stop(void)
 void cPluginEpgsync::Housekeeping(void)
 {
   // Perform any cleanup or other regular tasks.
+  if (EpgSyncSetup.everyHours && !EpgSyncThread->Active() &&
+		time(NULL) - EpgSyncThread->LastRun() > EpgSyncSetup.everyHours * 3600) {
+  	isyslog("Starting scheduled EpgSync");
+	EpgSyncThread->Start();
+  }
 }
 
 void cPluginEpgsync::MainThreadHook(void)
@@ -133,12 +138,26 @@ bool cPluginEpgsync::Service(const char *Id, void *Data)
 const char **cPluginEpgsync::SVDRPHelpPages(void)
 {
   // Return help text for SVDRP commands this plugin implements
-  return NULL;
+  static const char *HelpPages[] = {
+     "SYNC\n    Start EpgSync\n",
+     NULL
+  };
+  return HelpPages;
 }
 
 cString cPluginEpgsync::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
 {
   // Process SVDRP commands this plugin implements
+  if (!strcasecmp(Command, "SYNC")) {
+     if (EpgSyncThread->Active()) {
+        ReplyCode = 950;
+        return "EpgSync already active";
+     }
+     else {
+        EpgSyncThread->Start();
+        return "EpgSync started";
+     }
+  }
   return NULL;
 }
 
diff --git a/po/de_DE.po b/po/de_DE.po
index 5b54063..991e71e 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.7\n"
 "Report-Msgid-Bugs-To: <vdrdev at schmirler.de>\n"
-"POT-Creation-Date: 2013-05-01 00:01+0200\n"
+"POT-Creation-Date: 2014-03-13 10:47+0100\n"
 "PO-Revision-Date: 2009-02-03 11:23+0100\n"
 "Last-Translator: Frank Schmirler <vdrdev at schmirler.de>\n"
 "Language-Team: <vdr at linuxtv.org>\n"
@@ -52,6 +52,9 @@ msgstr "Kanalweise synchronisieren"
 msgid "EPG sync on startup"
 msgstr "EPG sync beim Starten"
 
+msgid "EPG sync timeout (h)"
+msgstr "Zeit bis zum EPG sync (h)"
+
 msgid "Map channels by"
 msgstr "Kan�le zuordnen nach"
 
diff --git a/po/it_IT.po b/po/it_IT.po
index 6855e48..ca59d6d 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.7\n"
 "Report-Msgid-Bugs-To: <vdrdev at schmirler.de>\n"
-"POT-Creation-Date: 2013-05-01 00:01+0200\n"
+"POT-Creation-Date: 2014-03-13 10:47+0100\n"
 "PO-Revision-Date: 2009-02-09 19:54+0100\n"
 "Last-Translator: Diego Pierotto <vdr-italian at tiscali.it>\n"
 "Language-Team:  <vdr at linuxtv.org>\n"
@@ -52,6 +52,9 @@ msgstr "Sincronizza canale per canale"
 msgid "EPG sync on startup"
 msgstr "Sincronizza EPG all'avvio"
 
+msgid "EPG sync timeout (h)"
+msgstr ""
+
 msgid "Map channels by"
 msgstr "Mappa canali per"
 
diff --git a/po/sk_SK.po b/po/sk_SK.po
index 82d0e79..796c832 100755
--- a/po/sk_SK.po
+++ b/po/sk_SK.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: vdr-epgsync 0.0.4\n"
 "Report-Msgid-Bugs-To: <vdrdev at schmirler.de>\n"
-"POT-Creation-Date: 2013-05-01 00:01+0200\n"
+"POT-Creation-Date: 2014-03-13 10:47+0100\n"
 "PO-Revision-Date: 2013-03-12 23:39+0100\n"
 "Last-Translator: Milan Hrala <hrala.milan at gmail.com>\n"
 "Language-Team: Slovak\n"
@@ -55,6 +55,9 @@ msgstr "Synchronyzova
 msgid "EPG sync on startup"
 msgstr "Synchronizova� EPG pri �tarte"
 
+msgid "EPG sync timeout (h)"
+msgstr "Interval EPG synchroniz�cie (h)"
+
 msgid "Map channels by"
 msgstr "Mapova� kan�ly pod�a"
 
diff --git a/setup.c b/setup.c
index a7a5126..6503713 100644
--- a/setup.c
+++ b/setup.c
@@ -20,6 +20,7 @@ cEpgSyncSetup::cEpgSyncSetup() {
 	nowNext = 0;
 	channelByChannel = 0;
 	syncOnStart = 0;
+	everyHours = 0;
 	redirectChannels = rcmId;
 	channelTypes = ctAll;
 }
@@ -32,6 +33,7 @@ cEpgSyncSetup& cEpgSyncSetup::operator=(const cEpgSyncSetup &Setup) {
 	nowNext = Setup.nowNext;
 	channelByChannel = Setup.channelByChannel;
 	syncOnStart = Setup.syncOnStart;
+	everyHours = Setup.everyHours;
 	redirectChannels = Setup.redirectChannels;
 	channelTypes = Setup.channelTypes;
 	return *this;
@@ -52,6 +54,8 @@ bool cEpgSyncSetup::Parse(const char *Name, const char *Value) {
 		channelByChannel = atoi(Value);
 	else if (!strcasecmp(Name, "SyncOnStart"))
 		syncOnStart = atoi(Value);
+	else if (!strcasecmp(Name, "EveryHours"))
+		everyHours = atoi(Value);
 	else if (!strcasecmp(Name, "RedirectChannels"))
 		redirectChannels = atoi(Value);
 	else if (!strcasecmp(Name, "ChannelTypes"))
@@ -69,6 +73,7 @@ void cEpgSyncMenuSetup::Store() {
 	SetupStore("NowNext", setupTmp.nowNext);
 	SetupStore("ChannelByChannel", setupTmp.channelByChannel);
 	SetupStore("SyncOnStart", setupTmp.syncOnStart);
+	SetupStore("EveryHours", setupTmp.everyHours);
 	SetupStore("RedirectChannels", setupTmp.redirectChannels);
 	SetupStore("ChannelTypes", setupTmp.channelTypes);
 	EpgSyncSetup = setupTmp;
@@ -94,6 +99,7 @@ cEpgSyncMenuSetup::cEpgSyncMenuSetup() {
 	Add(new cMenuEditBoolItem(tr("Update \"now\" and \"next\" first"), &setupTmp.nowNext));
 	Add(new cMenuEditBoolItem(tr("Sync channel by channel"), &setupTmp.channelByChannel));
 	Add(new cMenuEditBoolItem(tr("EPG sync on startup"), &setupTmp.syncOnStart));
+	Add(new cMenuEditIntItem(tr("EPG sync timeout (h)"), &setupTmp.everyHours, 0, INT_MAX, trVDR("off")));
 	Add(new cMenuEditStraItem(tr("Map channels by"), &setupTmp.redirectChannels, rcm_Count, redirectChannelsTexts));
 	Add(new cMenuEditStraItem(tr("Target channels"), &setupTmp.channelTypes, ct_Count, channelTypeTexts));
 }
diff --git a/setup.h b/setup.h
index 8dd6638..d16804e 100644
--- a/setup.h
+++ b/setup.h
@@ -26,6 +26,7 @@ struct cEpgSyncSetup {
 	int nowNext;
 	int channelByChannel;
 	int syncOnStart;
+	int everyHours;
 	int redirectChannels;
 	int channelTypes;
 
diff --git a/thread.c b/thread.c
index 08d2683..fa0999e 100644
--- a/thread.c
+++ b/thread.c
@@ -151,6 +151,7 @@ void cEpgSyncThread::Action() {
 
 	plugin->Service("SvdrpConnection-v1.0", &svdrp);
 	cSchedules::Cleanup(true);
+	last = time(NULL);
 }
 
 bool cEpgSyncThread::CmdLSTE(FILE *f, const char *Arg) {
@@ -239,6 +240,9 @@ void cEpgSyncThread::AddSchedule(FILE *f) {
 
 cEpgSyncThread::cEpgSyncThread(): cThread("epgsync") {
 	plugin = NULL;
+	// initialized to "now", so no scheduled sync right after VDR start
+	// use syncOnStart option instead
+	last = time(NULL);
 }
 
 cEpgSyncThread::~cEpgSyncThread() {
diff --git a/thread.h b/thread.h
index 3e31040..973f8ce 100644
--- a/thread.h
+++ b/thread.h
@@ -11,16 +11,19 @@
 #include <vdr/tools.h>
 #include <vdr/plugin.h>
 #include "svdrpservice.h"
+#include <time.h>
 
 class cEpgSyncThread: public cThread {
 	private:
 		cPlugin *plugin;
 		SvdrpConnection_v1_0 svdrp;
+		time_t last;
 	protected:
 		virtual void Action();
 		bool CmdLSTE(FILE *f, const char *Arg = NULL);
 		void AddSchedule(FILE *f);
 	public:
+		time_t LastRun() const { return last; };
 		cEpgSyncThread();
 		virtual ~cEpgSyncThread();
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr-plugin-epgsync.git



More information about the pkg-vdr-dvb-changes mailing list