Image cache and webroot support #141

Closed
wants to merge 3 commits into
from

Projects

None yet

2 participants

@adamsutton
Contributor

This adds support for a couple of new optional features in TVH:

  1. Webroot - allows TVH to server web pages from an alternative context, useful for those setting up TVH behind a rev proxy under a diff path.
  2. Image cache - images (channel logos etc..) can now be cached by TVH. To keep things clean and consistent (since these images can also be accessed directly via HTSP) the URIs provided a relative to server root (without webroot). So HTSPv8 clients must prepend the protocol and server details.
@opdenkamp opdenkamp commented on the diff Jan 7, 2013
addons/pvr.hts/src/HTSPData.cpp
@@ -867,10 +867,32 @@ void CHTSPData::ParseChannelUpdate(htsmsg_t* msg)
if((strIconPath = htsmsg_get_str(msg, "channelIcon")))
{
- if (channel.icon != strIconPath)
+ CStdString strIconURL;
+
+ if (strIconPath[0] != '/' || strIconPath[0] == '\0')
@opdenkamp
opdenkamp Jan 7, 2013 Owner

strIconPath.empty() is quicker

@opdenkamp opdenkamp commented on an outdated diff Jan 7, 2013
addons/pvr.hts/src/HTSPData.cpp
@@ -867,10 +867,32 @@ void CHTSPData::ParseChannelUpdate(htsmsg_t* msg)
if((strIconPath = htsmsg_get_str(msg, "channelIcon")))
{
- if (channel.icon != strIconPath)
+ CStdString strIconURL;
+
+ if (strIconPath[0] != '/' || strIconPath[0] == '\0')
+ {
+ strIconURL = strIconPath;
+ }
+ else
+ {
+ strIconURL = "http://";
+
+ if (g_strUsername != "")
@opdenkamp
opdenkamp Jan 7, 2013 Owner

same here

@opdenkamp opdenkamp commented on an outdated diff Jan 7, 2013
addons/pvr.hts/src/HTSPData.cpp
@@ -867,10 +867,32 @@ void CHTSPData::ParseChannelUpdate(htsmsg_t* msg)
if((strIconPath = htsmsg_get_str(msg, "channelIcon")))
{
- if (channel.icon != strIconPath)
+ CStdString strIconURL;
+
+ if (strIconPath[0] != '/' || strIconPath[0] == '\0')
+ {
+ strIconURL = strIconPath;
+ }
+ else
+ {
+ strIconURL = "http://";
+
+ if (g_strUsername != "")
+ {
+ strIconURL += g_strUsername;
+ if (g_strPassword != "")
@opdenkamp opdenkamp and 1 other commented on an outdated diff Jan 7, 2013
addons/pvr.hts/src/HTSPData.cpp
@@ -867,10 +867,32 @@ void CHTSPData::ParseChannelUpdate(htsmsg_t* msg)
if((strIconPath = htsmsg_get_str(msg, "channelIcon")))
{
- if (channel.icon != strIconPath)
+ CStdString strIconURL;
+
+ if (strIconPath[0] != '/' || strIconPath[0] == '\0')
+ {
+ strIconURL = strIconPath;
+ }
+ else
+ {
+ strIconURL = "http://";
+
+ if (g_strUsername != "")
+ {
+ strIconURL += g_strUsername;
@opdenkamp
opdenkamp Jan 7, 2013 Owner

and please use Format() for these things instead of concat

@adamsutton
adamsutton Jan 7, 2013 Contributor

@opdenkamp I copied the pattern from the dvr file url, maybe you should fix
that ;)
On Jan 7, 2013 10:34 PM, "Lars Op den Kamp" notifications@github.com
wrote:

In addons/pvr.hts/src/HTSPData.cpp:

@@ -867,10 +867,32 @@ void CHTSPData::ParseChannelUpdate(htsmsg_t* msg)

if((strIconPath = htsmsg_get_str(msg, "channelIcon")))
{

  • if (channel.icon != strIconPath)
  • CStdString strIconURL;
  • if (strIconPath[0] != '/' || strIconPath[0] == '\0')
  • {
  •  strIconURL = strIconPath;
    
  • }
  • else
  • {
  •  strIconURL = "http://";
    
  •  if (g_strUsername != "")
    
  •  {
    
  •    strIconURL += g_strUsername;
    

and please use Format() for these things instead of concat


Reply to this email directly or view it on GitHubhttps://github.com/opdenkamp/xbmc-pvr-addons/pull/141/files#r2570832.

@opdenkamp
opdenkamp Jan 7, 2013 Owner

probably :) (and I didn't write it)

@adamsutton
adamsutton Jan 7, 2013 Contributor

And I didn't say you did ;)
On Jan 7, 2013 10:59 PM, "Lars Op den Kamp" notifications@github.com
wrote:

In addons/pvr.hts/src/HTSPData.cpp:

@@ -867,10 +867,32 @@ void CHTSPData::ParseChannelUpdate(htsmsg_t* msg)

if((strIconPath = htsmsg_get_str(msg, "channelIcon")))
{

  • if (channel.icon != strIconPath)
  • CStdString strIconURL;
  • if (strIconPath[0] != '/' || strIconPath[0] == '\0')
  • {
  •  strIconURL = strIconPath;
    
  • }
  • else
  • {
  •  strIconURL = "http://";
    
  •  if (g_strUsername != "")
    
  •  {
    
  •    strIconURL += g_strUsername;
    

probably :) (and I didn't write it)


Reply to this email directly or view it on GitHubhttps://github.com/opdenkamp/xbmc-pvr-addons/pull/141/files#r2571113.

@adamsutton
Contributor

Sorry, messing about trying to tidy stuff up. So going to re-submit this one.

@adamsutton adamsutton closed this Jan 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment