X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/2601ee77efe1f10be7cbeb8af94e2fb229cc1ec1..742956672b795d0ffa44575f9a8e0255b768915c:/RecordTimer.py diff --git a/RecordTimer.py b/RecordTimer.py index f1b33592..2234bfc3 100644 --- a/RecordTimer.py +++ b/RecordTimer.py @@ -3,10 +3,12 @@ import codecs #from time import datetime from Tools import Directories, Notifications +from Components.config import config import timer import xml.dom.minidom from Screens.MessageBox import MessageBox +from Screens.SubserviceSelection import SubserviceSelection import NavigationInstance from Tools.XMLTools import elementsWithTag @@ -25,7 +27,7 @@ def parseEvent(ev): description = ev.getShortDescription() begin = ev.getBeginTime() end = begin + ev.getDuration() - eit = None + eit = ev.getEventId() return (begin, end, name, description, eit) class RecordTimerEntry(timer.TimerEntry): @@ -65,7 +67,7 @@ class RecordTimerEntry(timer.TimerEntry): self.record_service = NavigationInstance.instance.recordService(self.service_ref) if self.record_service == None: return False - else: + else: if self.record_service.prepare(self.Filename + ".ts"): self.record_service = None return False @@ -85,7 +87,10 @@ class RecordTimerEntry(timer.TimerEntry): self.prepareOK = True else: # error. - Notifications.AddNotificationWithCallback(self.failureCB, MessageBox, _("A timer failed to record!\nDisable TV and try again?\n")) + if config.recording.asktozap.value == 0: + Notifications.AddNotificationWithCallback(self.failureCB, MessageBox, _("A timer failed to record!\nDisable TV and try again?\n")) + else: # zap without asking + self.failureCB(True) elif event == self.EventStart: if self.prepareOK: self.record_service.start() @@ -98,6 +103,7 @@ class RecordTimerEntry(timer.TimerEntry): if self.prepareOK: self.record_service.stop() self.record_service = None + print "Timer successfully ended" else: print "prepare failed, thus nothing was recorded." @@ -108,8 +114,11 @@ class RecordTimerEntry(timer.TimerEntry): def failureCB(self, answer): if answer == True: - NavigationInstance.instance.stopUserServices() + #NavigationInstance.instance.stopUserServices() + print "[RecordTimer] zapping to", self.service_ref + NavigationInstance.instance.playService(self.service_ref.ref) self.activate(self.EventPrepare) + if self.wantStart: print "post-activating record" self.activate(self.EventStart)