small fix
[enigma2.git] / RecordTimer.py
index 215f9c3ab33930b3cc56e2d5471baac609896406..0f4256813aaa052c5a30542da1489eef0fa57d70 100644 (file)
@@ -482,27 +482,19 @@ class RecordTimer(timer.Timer):
                file.close()
 
        def getNextZapTime(self):
-               llen = len(self.timer_list)
-               idx = 0
                now = time.time()
-               while idx < llen:
-                       timer = self.timer_list[idx]
+               for timer in self.timer_list:
                        if not timer.justplay or timer.begin < now:
-                               idx += 1
-                       else:
-                               return timer.begin
+                               continue
+                       return timer.begin
                return -1
 
        def getNextRecordingTime(self):
-               llen = len(self.timer_list)
-               idx = 0
                now = time.time()
-               while idx < llen:
-                       timer = self.timer_list[idx]
+               for timer in self.timer_list:
                        if timer.justplay or timer.begin < now:
-                               idx += 1
-                       else:
-                               return timer.begin
+                               continue
+                       return timer.begin
                return -1
 
        def record(self, entry):
@@ -531,10 +523,20 @@ class RecordTimer(timer.Timer):
                                        sref.setUnsignedData(5, 0)
                                        sref.setUnsignedData(6, 0)
                                        check = x.service_ref.ref.toCompareString() == str(service)
+                                       num = 0
+                                       if check:
+                                               check = False
+                                               event = eEPGCache.getInstance().lookupEventId(sref, eventid)
+                                               num = event and event.getNumOfLinkageServices() or 0
                                        sref.setUnsignedData(1, sid)
                                        sref.setUnsignedData(2, tsid)
                                        sref.setUnsignedData(5, parent_sid)
                                        sref.setUnsignedData(6, parent_tsid)
+                                       for cnt in range(num):
+                                               subservice = event.getLinkageService(sref, cnt)
+                                               if sref.toCompareString() == subservice.toCompareString():
+                                                       check = True
+                                                       break
                        if check:
                                #if x.eit is not None and x.repeated == 0:
                                #       if x.eit == eventid: