add record margin
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 3 Feb 2006 21:30:49 +0000 (21:30 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 3 Feb 2006 21:30:49 +0000 (21:30 +0000)
RecordTimer.py
lib/python/Components/RecordingConfig.py

index 1e2aca1..4cfada5 100644 (file)
@@ -22,12 +22,15 @@ from ServiceReference import ServiceReference
 
 
 # parses an event, and gives out a (begin, end, name, duration, eit)-tuple.
+# begin and end will be corrected
 def parseEvent(ev):
        name = ev.getEventName()
        description = ev.getShortDescription()
        begin = ev.getBeginTime()
        end = begin + ev.getDuration()
        eit = ev.getEventId()
+       begin -= config.recording.margin_before.value[0] * 60
+       end += config.recording.margin_after.value[0] * 60
        return (begin, end, name, description, eit)
 
 # please do not translate log messages
index 99c15a6..1353f18 100644 (file)
@@ -4,6 +4,6 @@ from enigma import *
 
 def InitRecordingConfig():
        config.recording = ConfigSubsection();
-       config.recording.asktozap = configElement("config.recording.asktozap", configSelection, 1, (("yes", _("yes")), ("no", _("no"))) );
-
-
+       config.recording.asktozap = configElement("config.recording.asktozap", configSelection, 1, (("yes", _("yes")), ("no", _("no"))) )
+       config.recording.margin_before = configElement("config.recording.margin_before", configSequence, [0], configsequencearg.get("INTEGER", (0, 30)))
+       config.recording.margin_after = configElement("config.recording.margin_after", configSequence, [0], configsequencearg.get("INTEGER", (0, 30)))