fixed openwebif patch.
authorkos <kos@dev3>
Tue, 20 Aug 2013 03:06:40 +0000 (12:06 +0900)
committerkos <kos@dev3>
Tue, 20 Aug 2013 03:06:40 +0000 (12:06 +0900)
meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb
meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif/openwebif_8001_8002.patch

index 3902055..f6d4880 100644 (file)
@@ -9,7 +9,7 @@ RDEPENDS_${PN} = "python-cheetah python-json python-unixadmin python-misc python
 inherit gitpkgv
 PV = "0.1+git${SRCPV}"
 PKGV = "0.1+git${GITPKGV}"
 inherit gitpkgv
 PV = "0.1+git${SRCPV}"
 PKGV = "0.1+git${GITPKGV}"
-PR = "r0.75"
+PR = "r0.76"
 
 require openplugins.inc
 
 
 require openplugins.inc
 
index 909a9ae..3806e97 100644 (file)
@@ -1,66 +1,57 @@
 diff --git a/plugin/controllers/models/stream.py b/plugin/controllers/models/stream.py
 diff --git a/plugin/controllers/models/stream.py b/plugin/controllers/models/stream.py
-index fe4ddd4..71b1eaa 100644
+index c42ba76..4380052 100644
 --- a/plugin/controllers/models/stream.py
 +++ b/plugin/controllers/models/stream.py
 --- a/plugin/controllers/models/stream.py
 +++ b/plugin/controllers/models/stream.py
-@@ -25,11 +25,21 @@ def getStream(session, request, m3ufile):
+@@ -38,11 +38,16 @@ def getStream(session, request, m3ufile):
        if "name" in request.args:
                name = request.args["name"][0]
        # #EXTINF:-1,%s\n  remove not compatiple with old api
        if "name" in request.args:
                name = request.args["name"][0]
        # #EXTINF:-1,%s\n  remove not compatiple with old api
--      if sRef != '':
-+
++      portNumber = 8001
 +      if "device" in request.args :
 +              if request.args["device"][0] == "phone" :
 +                      portNumber = 8002;
 +      if "device" in request.args :
 +              if request.args["device"][0] == "phone" :
 +                      portNumber = 8002;
-+              else :
-+                      portNumber = config.OpenWebif.streamport.value
-+      else : 
-+              portNumber = config.OpenWebif.streamport.value
-+      
-+      if sRef != '' :
+       if sRef != '':
                progopt="#EXTVLCOPT:program=%d\n" % (int(sRef.split(':')[3],16))
        else:
                progopt=""
                progopt="#EXTVLCOPT:program=%d\n" % (int(sRef.split(':')[3],16))
        else:
                progopt=""
--      response = "#EXTM3U \n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:%s/%s\n" % (progopt,request.getRequestHostname(),config.OpenWebif.streamport.value, sRef)
+-      response = "#EXTM3U \n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:8001/%s\n" % (progopt,request.getRequestHostname(), sRef)
++      #response = "#EXTM3U \n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:8001/%s\n" % (progopt,request.getRequestHostname(), sRef)
 +      response = "#EXTM3U \n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:%s/%s\n" % (progopt,request.getRequestHostname(), portNumber, sRef)
 +      response = "#EXTM3U \n#EXTVLCOPT--http-reconnect=true \n%shttp://%s:%s/%s\n" % (progopt,request.getRequestHostname(), portNumber, sRef)
-+      
        request.setHeader('Content-Type', 'application/text')
        return response
  
 diff --git a/plugin/controllers/views/ajax/channels.tmpl b/plugin/controllers/views/ajax/channels.tmpl
        request.setHeader('Content-Type', 'application/text')
        return response
  
 diff --git a/plugin/controllers/views/ajax/channels.tmpl b/plugin/controllers/views/ajax/channels.tmpl
-index 5975ce8..2915c5b 100755
+index 9bad685..a8253d2 100755
 --- a/plugin/controllers/views/ajax/channels.tmpl
 +++ b/plugin/controllers/views/ajax/channels.tmpl
 --- a/plugin/controllers/views/ajax/channels.tmpl
 +++ b/plugin/controllers/views/ajax/channels.tmpl
-@@ -12,9 +12,12 @@
                                                      <a href="#" onclick="open_epg_pop('$channel.ref')">
                                                      <img src="../images/ico_epg.png" title="Show EPG for $channel.name" border="0">
                                                      </a>
--                                                      <a target="_blank" href='/web/stream.m3u?ref=$channel.ref&name=$channel.name'>
-+                                                      <a href="#" onclick="jumper8001('$channel.ref', '$channel.name');">
                                                      <img align="top" src="../images/ico_stream.png" title="Stream $channel.name" border="0">
                                                      </a>
-+                                                      <a href="#" onclick="jumper8002('$channel.ref', '$channel.name');">
-+                                                      <img align="top" src="../images/ico_stream.png" title="Stream Port 8002 $channel.name" border="0">
-+                                                      </a>
-                                               </div>
-                                       
- #if $channel.has_key('now_title')
+@@ -15,9 +15,12 @@
+ <a href="#" onclick="open_epg_pop('$channel.ref')">
+ <img src="../images/ico_epg.png" title="Show EPG for $channel.name" border="0">
+ </a>
+-<a target="_blank" href='/web/stream.m3u?ref=$channel.ref&name=$channel.name'>
++<a href="#" onclick="jumper8001('$channel.ref', '$channel.name');">
+ <img align="top" src="../images/ico_stream.png" title="Stream $channel.name" border="0">
+ </a>
++<a href="#" onclick="jumper8002('$channel.ref', '$channel.name');">
++<img align="top" src="../images/ico_stream.png" title="Stream Port 8002 $channel.name" border="0">
++</a>
+ #else
+ <a target="_blank" href='#'>
+ <img align="top" src="../images/ico_lock.png" title="Locked" border="0">
 diff --git a/plugin/controllers/views/main.tmpl b/plugin/controllers/views/main.tmpl
 diff --git a/plugin/controllers/views/main.tmpl b/plugin/controllers/views/main.tmpl
-index 1844226..6dcfb66 100755
+index 12b9941..3d0debc 100755
 --- a/plugin/controllers/views/main.tmpl
 +++ b/plugin/controllers/views/main.tmpl
 --- a/plugin/controllers/views/main.tmpl
 +++ b/plugin/controllers/views/main.tmpl
-@@ -9,6 +9,79 @@
+@@ -9,6 +9,69 @@
  <script type="text/javascript" src="/js/jquery-ui-1.8.18.custom.min.js"></script>\r
  <script type="text/javascript" src="/js/openwebif.js"></script>\r
  \r
 +<script>\r
  <script type="text/javascript" src="/js/jquery-ui-1.8.18.custom.min.js"></script>\r
  <script type="text/javascript" src="/js/openwebif.js"></script>\r
  \r
 +<script>\r
-+\r
 +      // VuPlus Port Jumper \r
 +      // 2012.12.10\r
 +      // VuPlus Port Jumper \r
 +      // 2012.12.10\r
-+\r
 +      function getWinSize(win) {                      \r
 +              if(!win) win = window;                  \r
 +              var s = {};                     \r
 +      function getWinSize(win) {                      \r
 +              if(!win) win = window;                  \r
 +              var s = {};                     \r
-+              \r
 +              if(typeof win.innerWidth != "undefined") {\r
 +                      s.screenWidth = win.screen.width;                               \r
 +                      s.screenHeight = win.screen.height;                     \r
 +              if(typeof win.innerWidth != "undefined") {\r
 +                      s.screenWidth = win.screen.width;                               \r
 +                      s.screenHeight = win.screen.height;                     \r
@@ -68,14 +59,12 @@ index 1844226..6dcfb66 100755
 +                      s.screenWidth = 0;                              \r
 +                      s.screenHeight = 0;                     \r
 +              }                       \r
 +                      s.screenWidth = 0;                              \r
 +                      s.screenHeight = 0;                     \r
 +              }                       \r
-+\r
 +              return s;               \r
 +      }\r
 +\r
 +      function getDeviceType() {\r
 +              var ss = getWinSize();  \r
 +              var screenLen = 0;\r
 +              return s;               \r
 +      }\r
 +\r
 +      function getDeviceType() {\r
 +              var ss = getWinSize();  \r
 +              var screenLen = 0;\r
-+\r
 +              // alert( ss.screenHeight );    \r
 +              // alert( ss.screenWidth );     \r
 +\r
 +              // alert( ss.screenHeight );    \r
 +              // alert( ss.screenWidth );     \r
 +\r
@@ -88,56 +77,50 @@ index 1844226..6dcfb66 100755
 +              if( screenLen < 500 ) {         \r
 +                      return "phone"; \r
 +              } else {\r
 +              if( screenLen < 500 ) {         \r
 +                      return "phone"; \r
 +              } else {\r
-+                      return "tab";   }\r
++                      return "tab";   \r
++              }\r
 +      }\r
 +\r
 +      function getOSType() {\r
 +              var agentStr = navigator.userAgent;\r
 +      }\r
 +\r
 +      function getOSType() {\r
 +              var agentStr = navigator.userAgent;\r
-+              \r
-+              if(agentStr.indexOf("iPod") > -1 || agentStr.indexOf("iPhone") > -1)                            \r
-+                      return "ios";   \r
-+              else if(agentStr.indexOf("Android") > -1)               \r
-+                      return "android";       \r
-+              else            \r
++\r
++              if(agentStr.indexOf("iPod") > -1 || agentStr.indexOf("iPhone") > -1)\r
++                      return "ios";\r
++              else if(agentStr.indexOf("Android") > -1)\r
++                      return "android";\r
++              else\r
 +                      return "unknown";\r
 +      }\r
 +\r
 +      function jumper8002( sref, sname ) {\r
 +              var deviceType = getDeviceType();\r
 +                      return "unknown";\r
 +      }\r
 +\r
 +      function jumper8002( sref, sname ) {\r
 +              var deviceType = getDeviceType();\r
-+\r
 +              document.portForm.ref.value = sref;\r
 +              document.portForm.name.value = sname;\r
 +              document.portForm.ref.value = sref;\r
 +              document.portForm.name.value = sname;\r
-+\r
 +              document.portForm.device.value = "phone";\r
 +              document.portForm.submit();\r
 +      }\r
 +\r
 +      function jumper8001( sref, sname ) {\r
 +              var deviceType = getDeviceType();\r
 +              document.portForm.device.value = "phone";\r
 +              document.portForm.submit();\r
 +      }\r
 +\r
 +      function jumper8001( sref, sname ) {\r
 +              var deviceType = getDeviceType();\r
-+\r
 +              document.portForm.ref.value = sref;\r
 +              document.portForm.name.value = sname;\r
 +              document.portForm.ref.value = sref;\r
 +              document.portForm.name.value = sname;\r
-+\r
 +              document.portForm.device.value = "etc";\r
 +              document.portForm.submit();\r
 +      }\r
 +              document.portForm.device.value = "etc";\r
 +              document.portForm.submit();\r
 +      }\r
-+\r
 +</script>\r
 +\r
 +</script>\r
 +\r
-+\r
  <title>Open Webif</title>\r
  </head>\r
  \r
  <title>Open Webif</title>\r
  </head>\r
  \r
-@@ -195,5 +268,12 @@
+@@ -196,5 +259,11 @@
                        <div id="footer"><h3>&nbsp;&nbsp;<a href="https://github.com/E2OpenPlugins">E2OpenPlugins</a> | <a href="http://www.vuplus-community.net">Black Hole</a> | <a href="http://openpli.org">OpenPli</a> | <a href="http://forum.sifteam.eu">Sif</a> | <a href="http://www.vuplus-support.org">Vti</a></h3></div>\r
                </div>\r
        </div>\r
                        <div id="footer"><h3>&nbsp;&nbsp;<a href="https://github.com/E2OpenPlugins">E2OpenPlugins</a> | <a href="http://www.vuplus-community.net">Black Hole</a> | <a href="http://openpli.org">OpenPli</a> | <a href="http://forum.sifteam.eu">Sif</a> | <a href="http://www.vuplus-support.org">Vti</a></h3></div>\r
                </div>\r
        </div>\r
-+      \r
++\r
 +      <form name="portForm" action="/web/stream.m3u" method="GET" target="_blank">\r
 +              <input type="hidden" name="ref">\r
 +              <input type="hidden" name="name">\r
 +              <input type="hidden" name="device">\r
 +      </form>\r
 +      <form name="portForm" action="/web/stream.m3u" method="GET" target="_blank">\r
 +              <input type="hidden" name="ref">\r
 +              <input type="hidden" name="name">\r
 +              <input type="hidden" name="device">\r
 +      </form>\r
-+      \r
  </body>\r
  </html>\r
  </body>\r
  </html>\r