permit also to record from service groups (services with associated alternative services)
authorghost <andreas.monzner@multimedia-labs.de>
Mon, 4 Oct 2010 08:23:07 +0000 (10:23 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Mon, 4 Oct 2010 08:27:19 +0000 (10:27 +0200)
RecordTimer.py
ServiceReference.py
lib/python/Screens/TimerEntry.py

index def7568..4ece9c5 100755 (executable)
@@ -102,7 +102,7 @@ class RecordTimerEntry(timer.TimerEntry, object):
                
                assert isinstance(serviceref, ServiceReference)
                
-               if serviceref.getType() == eServiceReference.idDVB and serviceref.getPath() == "":
+               if serviceref.isRecordable():
                        self.service_ref = serviceref
                else:
                        self.service_ref = ServiceReference(None)
index 5d11ae7..4907fa2 100644 (file)
@@ -10,7 +10,7 @@ class ServiceReference(eServiceReference):
 
        def __str__(self):
                return self.ref.toString()
-       
+
        def getServiceName(self):
                info = self.info()
                return info and info.getName(self.ref) or ""
@@ -20,9 +20,16 @@ class ServiceReference(eServiceReference):
 
        def list(self):
                return self.serviceHandler.list(self.ref)
-       
+
        def getType(self):
                return self.ref.type
-       
+
        def getPath(self):
                return self.ref.getPath()
+
+       def getFlags(self):
+               return self.ref.flags
+
+       def isRecordable(self):
+               ref = self.ref
+               return ref.flags & eServiceReference.isGroup or (ref.type == eServiceReference.idDVB and ref.getPath() == "")
\ No newline at end of file
index 62faf9b..9885e70 100644 (file)
@@ -278,7 +278,7 @@ class TimerEntry(Screen, ConfigListScreen):
                        self.keyGo()
 
        def keyGo(self, result = None):
-               if self.timerentry_service_ref.getType() != eServiceReference.idDVB or self.timerentry_service_ref.getPath() != "":
+               if not self.timerentry_service_ref.isRecordable():
                        self.session.openWithCallback(self.selectChannelSelector, MessageBox, _("You didn't select a channel to record from."), MessageBox.TYPE_ERROR)
                        return
                self.timer.name = self.timerentry_name.value