display clock png in single epg list for fitting timers (we have a problem with the...
[enigma2.git] / RecordTimer.py
index 9bb1da7..9f78ff2 100644 (file)
@@ -86,7 +86,10 @@ class RecordTimerEntry(timer.TimerEntry):
                        self.log(1, "'record service' failed")
                        return False
                else:
-                       prep_res = self.record_service.prepare(self.Filename + ".ts")
+                       event_id = self.eit
+                       if event_id is None:
+                               event_id = -1
+                       prep_res = self.record_service.prepare(self.Filename + ".ts", self.begin, self.end, event_id )
                        if prep_res:
                                self.log(2, "'prepare' failed: error %d" % prep_res)
                                self.record_service = None
@@ -218,7 +221,7 @@ class RecordTimer(timer.Timer):
                        self.loadTimer()
                except IOError:
                        print "unable to load timers from file!"
-
+                       
        def isRecording(self):
                isRunning = False
                for timer in self.timer_list:
@@ -322,6 +325,32 @@ class RecordTimer(timer.Timer):
                print "[Timer] Record " + str(entry)
                entry.Timer = self
                self.addTimerEntry(entry)
+               
+       def isInTimer(self, eventid, begin, duration, service):
+               time_match = 0
+               for x in self.timer_list:
+                       if str(x.service_ref) == str(service):
+                               if x.eit is not None and x.repeated == 0:
+                                       if x.eit == eventid:
+                                               return duration
+                               elif x.repeated != 0:
+                                       # TODO: implement!
+                                       pass
+                               elif x.eit is None:
+                                       end = begin + duration
+                                       if begin <= x.begin <= end:
+                                               diff = end - x.begin
+                                               if time_match < diff:
+                                                       time_match = diff
+                                       elif x.begin <= begin <= x.end:
+                                               diff = x.end - begin
+                                               if time_match < diff:
+                                                       time_match = diff
+               return time_match
+                                                       
+                                               
+                                               
+                       
 
        def removeEntry(self, entry):
                print "[Timer] Remove " + str(entry)