summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorDave <vdr@pickles.me.uk>2012-01-05 12:39:24 +0000
committerDave <vdr@pickles.me.uk>2012-01-05 12:39:24 +0000
commitb558c7698348c084e6399afb7888f71c201d061f (patch)
tree736f80cab5b21225d16e0b691fd89ffc04280d11 /plugin
parentf7e145c7689250cae1136475b1b7373bb6717644 (diff)
downloadvdrtva-0.0.6.tar.gz
vdrtva-0.0.6.tar.bz2
Fixed bug in processing updates.v0.0.6
Diffstat (limited to 'plugin')
-rw-r--r--plugin/HISTORY5
-rw-r--r--plugin/README26
-rw-r--r--plugin/README - series48
-rw-r--r--plugin/TODO3
-rw-r--r--plugin/vdrtva.c34
5 files changed, 45 insertions, 71 deletions
diff --git a/plugin/HISTORY b/plugin/HISTORY
index 1efd82e..93a7782 100644
--- a/plugin/HISTORY
+++ b/plugin/HISTORY
@@ -24,3 +24,8 @@ VDR Plugin 'vdrtva' Revision History
- Added check for series links whenever a new timer is added.
- Added setup menu (not fully tested).
+
+2012-01-05 Version 0.0.6
+- Configuration of update time changed.
+- Fixed bug in processing of updates.
+- Patch version is now deprecated.
diff --git a/plugin/README b/plugin/README
index 37cd204..7a9b012 100644
--- a/plugin/README
+++ b/plugin/README
@@ -11,7 +11,7 @@ published by ETSI and are available without cost from www.etsi.org. The main
standard is ETSI TS 102 323.
In the UK a subset of the TV-Anytime specification is broadcast on the DTV
-service under the trade name "FreeView Plus". This patch is written for the UK
+service under the trade name "FreeView Plus". This plugin is written for the UK
version but should work with the full specification (untested).
TV-Anytime data is contained in Content Reference Identifiers (CRIDs). The
@@ -51,11 +51,11 @@ The use of the 'Accurate Recording' feature is described in README-vps.
The plugin runs every 24 hours at a time set by the '-u' parameter (default
03:00). It captures CRID data for a time (10 minutes) then:
+- Checks for new manually-created timers and adds series links for them.
+
- Checks each series link to see if any new events have been added to the EPG in
the same series. If so then timers are added for them.
-- Checks for new manually-created timers and adds series links for them.
-
- Checks for timer clashes and suggests possible alternative recording times.
- Checks that the event being recorded by each timer is the same as when the
@@ -77,5 +77,23 @@ STRT
UPDT Trigger an update of the series links.
+Points to remember:
+
+- Not all channels on UK Freeview have CRIDs in the EPG Some radio channels
+ have item CRIDs but none have series CRIDs.
+
+- Different programme providers have different ideas of what constitutes a
+ 'series'.
+
+- The timer creation process is very simplistic; it doesn't check for timer
+ clashes, and selects the first physical entry in the EPG (which may not be
+ the prime broadcast of the programme).
+
+- A series link is created for every timer whether you want one or not.
+
+- This script has not been tested with multiple tuner cards or with mixed DVB-T
+ and DVB-S setups.
+
-This is Alpha-quality code - USE AT YOUR OWN RISK!!
+Although I use this software on my VDR installation, this is Alpha-quality code
+- USE AT YOUR OWN RISK!!
diff --git a/plugin/README - series b/plugin/README - series
deleted file mode 100644
index 1450945..0000000
--- a/plugin/README - series
+++ /dev/null
@@ -1,48 +0,0 @@
-This is a very simple script to demonstrate the 'series link' concept. Run it
-every day as a cron job and never miss your favourite series again! Just create
-a timer for the first programme in a series and the script will automatically
-record the rest for you.
-
-Configuration parameters at the start of the file must be set to match your vdr
-settings. The 'padding' values must match those used when you manually set
-timers (eg when using vdradmin).
-
-If you set the 'VPS' config parameter to '1', and also set 'UseVps = 1' and
-'VpsFallack=1' in VDR's setup.conf, new timers will be created to use the EIT
-Running Status to set start and end times. An accurate Running Status is a
-requirement of the Freeview Plus specification. However if the programme starts
-earlier than (scheduled time - VpsMargin) the beginning will be missed.
-
-The script detects split events, eg a film with a news summary in the middle,
-and ensures that if a timer is set for one part, all parts of the programme are
-recorded (as separate timers). The script also checks for timer clashes, though
-it doesn't try to resolve the clash, and also warns if the title of an event in
-the EPG has changed since the timer was set (so perhaps a different programme is
-being broadcast).
-
-The script creates a file "links.data" in the vdr directory when run. This file
-contains series CRIDs of all of the timers which have been set, and the item
-CRIDs of the individual programmes which have had recordings scheduled. A
-timestamp against each entry gives the date of the last timer set, so that old
-series can be automatically purged.
-
-Points to remember:
-
-- Not all channels on UK Freeview have CRIDs in the EPG (at present just the
- BBC, ITV, C4 and C5 stables plus Sky 3 and Virgin 1). Some radio channels
- have item CRIDs but none have series CRIDs.
-
-- Different programme providers have different ideas of what constitutes a
- 'series'.
-
-- The timer creation process is very simplistic; it doesn't check for timer
- clashes, and selects the first physical entry in the EPG (which may not be
- the prime broadcast of the programme).
-
-- A series link is created for every timer whether you want one or not.
-
-- If you run this script overnight, a timer set one day which fires on the same
- day will not create a series link (because the timer no longer exists).
-
-- This script has not been tested with multiple tuner cards or with mixed DVB-T
- and DVB-S setups.
diff --git a/plugin/TODO b/plugin/TODO
index 8e78452..9b9a913 100644
--- a/plugin/TODO
+++ b/plugin/TODO
@@ -7,7 +7,4 @@ Missing functions from Perl script:
Timer clash check code needs to cope with multiple tuner cards.
-Maybe add a timer callback so that a series can be registered immediately
-instead of waiting for an overnight update.
-
Config file
diff --git a/plugin/vdrtva.c b/plugin/vdrtva.c
index c105c44..bfc45cf 100644
--- a/plugin/vdrtva.c
+++ b/plugin/vdrtva.c
@@ -21,7 +21,7 @@ cChanDAs *ChanDAs;
cEventCRIDs *EventCRIDs;
cLinks *Links;
-static const char *VERSION = "0.0.5";
+static const char *VERSION = "0.0.6";
static const char *DESCRIPTION = "TV-Anytime plugin";
static const char *MAINMENUENTRY = "vdrTva";
@@ -29,8 +29,8 @@ int collectionperiod; // Time to collect all CRID data (default 10 minutes)
int lifetime; // Lifetime of series link recordings (default 99)
int priority; // Priority of series link recordings (default 99)
int seriesLifetime; // Expiry time of a series link (default 30 days)
-int updatehours; // Time to carry out the series link update (default 03:00)
-int updatemins;
+int updatetime; // Time to carry out the series link update HHMM (default 03:00)
+
class cPluginvdrTva : public cPlugin {
@@ -101,8 +101,7 @@ cPluginvdrTva::cPluginvdrTva(void)
flags = 5;
state = 0;
collectionperiod = 10 * 60;
- updatehours = 3;
- updatemins = 0;
+ updatetime = 300;
}
cPluginvdrTva::~cPluginvdrTva()
@@ -152,8 +151,7 @@ bool cPluginvdrTva::ProcessArgs(int argc, char *argv[])
strncpy(buf, optarg,sizeof(buf));
hours = strtok_r(buf, ":", &strtok_next);
mins = strtok_r(NULL, "!", &strtok_next);
- updatehours = atoi(hours);
- updatemins = atoi(mins);
+ updatetime = atoi(hours)*100 + atoi(mins);
break;
default:
return false;
@@ -179,8 +177,8 @@ bool cPluginvdrTva::Start(void)
time_t now = time(NULL);
localtime_r(&now, &tm_r);
tm_r.tm_sec = 0;
- tm_r.tm_hour = updatehours;
- tm_r.tm_min = updatemins;
+ tm_r.tm_hour = updatetime / 100;
+ tm_r.tm_min = updatetime % 100;
nextactiontime = mktime(&tm_r);
if (nextactiontime < now) nextactiontime += SECONDSPERDAY;
ctime_r(&nextactiontime, buff);
@@ -224,7 +222,7 @@ void cPluginvdrTva::Housekeeping(void)
}
}
else if (EventCRIDs && statusMonitor->GetTimerAddedDelta() > 60) {
- Update();
+ Update(); // Wait 1 minute for VDR to enter the event data into the new timer.
Check();
statusMonitor->ClearTimerAdded();
}
@@ -267,6 +265,7 @@ bool cPluginvdrTva::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "SeriesLifetime")) seriesLifetime = atoi(Value);
else if (!strcasecmp(Name, "TimerLifetime")) lifetime = atoi(Value);
else if (!strcasecmp(Name, "TimerPriority")) priority = atoi(Value);
+ else if (!strcasecmp(Name, "UpdateTime")) updatetime = atoi(Value);
else return false;
return true;
}
@@ -426,10 +425,9 @@ void cPluginvdrTva::StopDataCapture()
void cPluginvdrTva::Update()
{
- if(
- UpdateLinksFromTimers() ||
- AddNewEventsToSeries()
- ) SaveLinksFile();
+ bool status = UpdateLinksFromTimers();
+ status |= AddNewEventsToSeries();
+ if(status) SaveLinksFile();
isyslog("vdrtva: Updates complete");
}
@@ -641,6 +639,9 @@ void cPluginvdrTva::CheckChangedEvents()
}
}
+// Check for timer clashes - overlapping timers which are not on the same transponder.
+// FIXME How to deal with multiple input devices??
+
void cPluginvdrTva::CheckTimerClashes(void)
{
if (Timers.Count() < 2) return;
@@ -739,12 +740,12 @@ cTvaMenuSetup::cTvaMenuSetup(void)
newlifetime = lifetime;
newpriority = priority;
newseriesLifetime = seriesLifetime;
- newupdatehours = updatehours;
- newupdatemins = updatemins;
+ newupdatetime = updatetime;
Add(new cMenuEditIntItem(tr("Collection period (min)"), &newcollectionperiod));
Add(new cMenuEditIntItem(tr("Series link lifetime (days)"), &newseriesLifetime));
Add(new cMenuEditIntItem(tr("New timer lifetime"), &newlifetime));
Add(new cMenuEditIntItem(tr("New timer priority"), &newpriority));
+ Add(new cMenuEditIntItem(tr("Update Time (HHMM)"), &newupdatetime));
}
void cTvaMenuSetup::Store(void)
@@ -753,6 +754,7 @@ void cTvaMenuSetup::Store(void)
SetupStore("SeriesLifetime", newseriesLifetime);
SetupStore("TimerLifetime", newlifetime);
SetupStore("TimerPriority", newpriority);
+ SetupStore("UpdateTime", newupdatetime);
}