summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave <vdr@pickles.me.uk>2010-05-09 13:18:23 +0100
committerDave <vdr@pickles.me.uk>2010-05-09 13:18:23 +0100
commit3c285955dfb830cbd6fa97621afc1dc29997001b (patch)
tree6a0c80b2b8e4c72fcd4e834301f40639d551e7d9
parent70eee37e26e56576444de9ce26628dcfb7d18d32 (diff)
downloadvdrtva-3c285955dfb830cbd6fa97621afc1dc29997001b.tar.gz
vdrtva-3c285955dfb830cbd6fa97621afc1dc29997001b.tar.bz2
Check timer events for EPG changes.
-rw-r--r--HISTORY3
-rw-r--r--README - series2
-rwxr-xr-xseries.pl25
3 files changed, 26 insertions, 4 deletions
diff --git a/HISTORY b/HISTORY
index d9e3996..0250b74 100644
--- a/HISTORY
+++ b/HISTORY
@@ -34,3 +34,6 @@
- timers.c - Modify VPS patch to use a new config parameter 'VpsFallback' to determine whether to use Running Status for accurate recording. Config changes based on the Mandriva source for vdr.
- epg.c - Change the ID letters used for the CRIDs in epg.data to X and Y, because vdr now uses R for Parental Rating. Note that this will cause error messages in the log when viewing old recordings but these are harmless.
- vdr.5 - Updated man page with new CRID IDs.
+
+2010/5/9 - Version 0.0.8 (vdr versions 1.6.0-2 and 1.7.14)
+series.pl - Ensure that all parts of split events (eg a long film with a news summary in the middle) are recorded. Warn if the title of an event in the EPG has changed since a timer was set - maybe it is no longer the same programme...
diff --git a/README - series b/README - series
index 9f596c2..23235c0 100644
--- a/README - series
+++ b/README - series
@@ -5,7 +5,7 @@ settings. The 'padding' values must match those used when you manually set timer
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.
+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.
diff --git a/series.pl b/series.pl
index ac4fa84..1ba8a41 100755
--- a/series.pl
+++ b/series.pl
@@ -57,6 +57,7 @@ if ($updates) {
}
#show_links();
check_timer_clashes();
+check_changed_events();
close_SVDRP();
# Examine each timer and update the links file if necessary (manually-added timers)
@@ -151,7 +152,8 @@ sub check_timer_clashes
# What to do?? For now just report the collision
my $ttl1 = get_title($chans[$timers[$ii]->{chan}-1]->{id}, $tstart[$ii]+$CONFIG{START_PADDING}*60);
my $ttl2 = get_title($chans[$timers[$jj]->{chan}-1]->{id}, $tstart[$jj]+$CONFIG{START_PADDING}*60);
- print STDOUT "Collision! $timers[$ii]->{day} $timers[$ii]->{start}\n$ttl1 <-> $ttl2\n";
+ my $when = localtime ($timers[$ii]->{tstart});
+ print STDOUT "Collision! $when\n$ttl1 <-> $ttl2\n";
}
}
}
@@ -213,6 +215,22 @@ sub check_split_recordings {
return $count;
}
+# Scan the timers list for events which have changed since the timer was
+# set. For now we just report the error. TODO: if the event has moved maybe # we should try to find the new one?
+
+sub check_changed_events {
+
+ print STDOUT "Checking for changed timer events\n";
+ foreach my $timer (@timers) {
+ my $channelid = $chans[$timer->{chan}-1] -> {id};
+ my $start_t = $timer->{tstart};
+ my $timer_title = $timer ->{title};
+ my $event_title = get_title ($channelid, $start_t);
+ if ($timer_title ne $event_title) {
+ print STDOUT "Event: $event_title <=> Timer: $timer_title\n";
+ }
+ }
+}
# Read the timers from VDR
@@ -222,7 +240,7 @@ sub get_timers {
while (<SOCK>) {
chomp;
/^\d*([- ])\d* (.*)/;
- my ($flag,$chan,$day,$start,$stop) = split(':', $2);
+ my ($flag,$chan,$day,$start,$stop,$prio,$life,$title) = split(':', $2);
my ($yy,$mm,$dd) = split('-', $day);
my $starth = $start / 100;
my $startm = $start % 100;
@@ -237,7 +255,8 @@ sub get_timers {
flag => $flag,
chan => $chan,
tstart => $tstart,
- tstop => $tstop
+ tstop => $tstop,
+ title => $title
});
# last if substr($_, 3, 1) ne "-";
last if $1 ne "-";