yweb 2.8.0.3 new logo handling and some fixes to EPG Plus

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@530 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
yjogol
2010-03-27 18:00:24 +00:00
parent cdab9d60bf
commit 9823c3a34a
11 changed files with 58 additions and 22 deletions

View File

@@ -190,7 +190,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
{"updatebouquet", &CControlAPI::updateBouquetCGI, "text/plain"},
// utils
{"build_live_url", &CControlAPI::build_live_url, ""},
{"get_logo", &CControlAPI::logoCGI, "text/plain"},
};
//-----------------------------------------------------------------------------
@@ -844,11 +844,13 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh)
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"</id>\n\t<short_id>"
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"</short_id>\n\t<name><![CDATA[%s]]></name>\n</channel>\n",
"</short_id>\n\t<name><![CDATA[%s]]></name>\n<logo><![CDATA[%s]]></logo>\n</channel>\n",
num + j,
channel->channel_id,
channel->channel_id&0xFFFFFFFFFFFFULL,
channel->getName().c_str());
channel->getName().c_str(),
NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->channel_id).c_str()
);
}
hh->WriteLn("</bouquetlist>");
}
@@ -1927,3 +1929,12 @@ void CControlAPI::build_live_url(CyhookHandler *hh)
hh->Write(url);
}
}
//-------------------------------------------------------------------------
void CControlAPI::logoCGI(CyhookHandler *hh)
{
t_channel_id channel_id;
sscanf(hh->ParamList["1"].c_str(),
SCANF_CHANNEL_ID_TYPE,
&channel_id);
hh->Write(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel_id));
}

View File

@@ -94,6 +94,7 @@ private:
void changeBouquetCGI(CyhookHandler *hh);
void updateBouquetCGI(CyhookHandler *hh);
void build_live_url(CyhookHandler *hh);
void logoCGI(CyhookHandler *hh);
protected:
static const unsigned int PLUGIN_DIR_COUNT = 5;

View File

@@ -479,3 +479,21 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void) {
return out.str();
}
//-------------------------------------------------------------------------
std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channelId) {
std::string channelIdAsString = string_printf( PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS , channelId & 0xFFFFFFFFFFFFULL);
std::string channelName = GetServiceName(channelId);
replace(channelName, " ", "_");
_logoURL+="/";
if(access((_logoURL + channelIdAsString + ".jpg").c_str(), 4) == 0)
return _logoURL + channelIdAsString + ".jpg";
else if (access((_logoURL + channelIdAsString + ".gif").c_str(), 4) == 0)
return _logoURL + channelIdAsString + ".gif";
else if (access((_logoURL + channelName + ".jpg").c_str(), 4) == 0)
return _logoURL + channelName + ".jpg";
else if (access((_logoURL + channelName + ".gif").c_str(), 4) == 0)
return _logoURL + channelName + ".gif";
else
return "";
}

View File

@@ -76,6 +76,7 @@ class CNeutrinoAPI
std::string getVideoFramerateAsString(void);
std::string getAudioInfoAsString(void);
std::string getCryptInfoAsString(void);
std::string getLogoFile(std::string _logoURL, t_channel_id channelId);
public:
CNeutrinoAPI();
~CNeutrinoAPI(void);

View File

@@ -95,7 +95,7 @@ THandleStatus CNeutrinoYParser::Hook_ReadConfig(CConfigFile *Config, CStringList
Config->setInt32("configfile.version", CONF_VERSION);
Config->saveConfig(HTTPD_CONFIGFILE);
}
std::string logo = ConfigList["TUXBOX_LOGOS_URL"];
return HANDLED_CONTINUE;
}
@@ -342,15 +342,12 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
std::string bouquetstr = (BouquetNr >= 0) ? ("&amp;bouquet=" + itoa(BouquetNr)) : "";
yresult += "<tr>";
//FIXME: Logo-Extensions
if(have_logos)
yresult += string_printf("<td class=\"%c\" width=\"44\" rowspan=\"2\"><a href=\"javascript:do_zap('"
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"')\"><img class=\"channel_logo\" src=\"%s/"
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
".jpg\"/></a></td>", classname, channel->channel_id,
(hh->WebserverConfigList["Tuxbox.LogosURL"]).c_str(),
channel->channel_id & 0xFFFFFFFFFFFFULL);
"')\"><img class=\"channel_logo\" src=\"%s\"/></a></td>", classname, channel->channel_id,
(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->channel_id)).c_str());
/* timer slider */
if(event && event->duration > 0)