Navigation: Fix zapping along services with alternatives
authorLittlesat <littlesat99@yahoo.com>
Thu, 2 Aug 2012 22:21:37 +0000 (00:21 +0200)
committerLittlesat <littlesat99@yahoo.com>
Thu, 2 Aug 2012 22:21:37 +0000 (00:21 +0200)
When zapping along a service that had an alternative we were zapping
incorrectly and even the channel number was incorrect. This was intro-
duced since I added the setcurrent call to the service list. This
was caused due to the fact some alternative ref could be stored there
instead of the orriginal reference.

Navigation.py

index 7da7709..7a38c3e 100644 (file)
@@ -85,7 +85,7 @@ class Navigation:
                                self.currentlyPlayingServiceReference = playref
                                InfoBarInstance = InfoBar.instance
                                if InfoBarInstance is not None:
-                                       InfoBarInstance.servicelist.servicelist.setCurrent(playref)
+                                       InfoBarInstance.servicelist.servicelist.setCurrent(ref)
                                if self.pnav.playService(playref):
                                        print "Failed to start", playref
                                        self.currentlyPlayingServiceReference = None
@@ -100,8 +100,7 @@ class Navigation:
        def recordService(self, ref, simulate=False):
                service = None
                if not simulate: print "recording service: %s" % (str(ref))
-               if isinstance(ref, ServiceReference.ServiceReference):
-                       ref = ref.ref
+               if isinstance(ref, ServiceReference.ServiceReference):                  ref = ref.ref
                if ref:
                        if ref.flags & eServiceReference.isGroup:
                                ref = getBestPlayableServiceReference(ref, eServiceReference(), simulate)