add Title to Zap URL
authorRico Schulte <ricoschulte@users.schwerkraft.elitedvb.net>
Wed, 2 Jun 2010 17:52:53 +0000 (17:52 +0000)
committerRico Schulte <ricoschulte@users.schwerkraft.elitedvb.net>
Wed, 2 Jun 2010 17:52:53 +0000 (17:52 +0000)
http://dm8000/web/zap?sRef=<ServiceReference>&title=<TitleString>

usefull with remote playing of streams to the a custom title that is displayed instead of the streamurl (Podcasttitle instead of the url to the stream)

must not be set or can be blank to be backward compatible

webinterface/src/WebComponents/Sources/SwitchService.py
webinterface/src/web/zap.xml

index b4bdfa2..cf56306 100644 (file)
@@ -11,8 +11,8 @@ class SwitchService(Source):
        def handleCommand(self, cmd):           
                self.res = self.switchService(cmd)
                
-       def switchService(self, ref):
-               print "[SwitchService] ref=%s" %ref
+       def switchService(self, cmd):
+               print "[SwitchService] ref=%s" %cmd["sRef"]
                
                pc = config.ParentalControl.configured.value
 
@@ -23,11 +23,14 @@ class SwitchService(Source):
                if pc:
                        config.ParentalControl.configured.value = False
                if config.plugins.Webinterface.allowzapping.value:
-                       self.session.nav.playService(eServiceReference(ref))    
+                       eref= eServiceReference(cmd["sRef"])
+                       if cmd["title"] is not None:
+                               eref.setName(cmd["title"])
+                       self.session.nav.playService(eref)      
                        if pc:
                                config.ParentalControl.configured.value = pc
                        
-                       return ( True, "Active service switched to %s" %ref )
+                       return ( True, "Active service switched to %s" %cmd["sRef"] )
                
                else:
                        return ( False, "Zapping is disabled in WebInterface Configuration" )
index ccfc3d7..1d071c9 100644 (file)
@@ -1,5 +1,5 @@
 <e2:screen name="SwitchServiceWebScreen">&lt;?xml version="1.0" encoding="UTF-8"?>
-<e2:element source="SwitchService" id="sRef">
+<e2:element source="SwitchService" id="sRef,title">
        <e2:convert type="web:Null" />
 </e2:element>