Alternatives: Fix alternative being shown as unavailable service.
authordima73 <dima73@dev.null>
Fri, 23 Jan 2015 10:42:14 +0000 (11:42 +0100)
committerErik Slagter <erik@slagter.name>
Fri, 23 Jan 2015 10:43:14 +0000 (11:43 +0100)
Signed-off-by: Erik Slagter <erik@slagter.name>

Navigation.py
lib/python/Screens/ChannelSelection.py

index cb57ffe..fcde907 100644 (file)
@@ -78,9 +78,16 @@ class Navigation:
                                if playref and oldref and playref == oldref and not forceRestart:
                                        print "ignore request to play already running service(2)"
                                        return 1
-                               if not playref or (checkParentalControl and not parentalControl.isServicePlayable(playref, boundFunction(self.playService, checkParentalControl = False))):
+                               if not playref:
+                                       alternativeref = getBestPlayableServiceReference(ref, eServiceReference(), True)
                                        self.stopService()
+                                       if alternativeref and self.pnav and self.pnav.playService(alternativeref):
+                                               print "Failed to start", alternativeref
                                        return 0
+                               elif checkParentalControl and not parentalControl.isServicePlayable(playref, boundFunction(self.playService, checkParentalControl = False)):
+                                       if self.currentlyPlayingServiceOrGroup and InfoBarInstance and InfoBarInstance.servicelist.servicelist.setCurrent(self.currentlyPlayingServiceOrGroup, adjust):
+                                               self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent()
+                                       return 1
                        else:
                                playref = ref
                        if self.pnav:
index b4089b2..d70dc69 100644 (file)
@@ -2108,7 +2108,8 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect
                self.close(None)
 
        def zapBack(self):
-               if self.startServiceRef and self.session.nav.getCurrentlyPlayingServiceOrGroup() != self.startServiceRef:
+               currentPlayedRef = self.session.nav.getCurrentlyPlayingServiceOrGroup()
+               if self.startServiceRef and (currentPlayedRef is None or currentPlayedRef != self.startServiceRef):
                        self.setStartRoot(self.startRoot)
                        self.new_service_played = True
                        self.session.nav.playService(self.startServiceRef)
@@ -2121,7 +2122,7 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect
                        # This unfortunately won't work with subservices
                        self.setCurrentSelection(self.session.pip.getCurrentService())
                else:
-                       self.setCurrentSelection(self.session.nav.getCurrentlyPlayingServiceOrGroup())
+                       self.setCurrentSelection(currentPlayedRef)
 
        def setStartRoot(self, root):
                if root: