Merge branch 'cst-next' of git://coolstreamtech.de/cst-public-gui-neutrino into ni/cst-next

Origin commit data
------------------
Branch: ni/coolstream
Commit: 29009126df
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-26 (Fri, 26 Aug 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2016-08-26 16:06:36 +02:00
7 changed files with 43 additions and 35 deletions

View File

@@ -1121,7 +1121,7 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel *
result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true);
result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()&0xFFFFFFFFFFFFULL), true);
result += hh->outPair("name", hh->outValue(channel->getName()), true);
result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID())), false);
result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(channel->getChannelID())), false);
if (bouquetNr > -1)
{
result += hh->outNext();
@@ -3155,7 +3155,7 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh)
CZapitChannel * channel = chanlist[j];
std::string bouq_name = g_bouquetManager->Bouquets[i]->Name;
std::string chan_id_short = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL);
result += "#EXTINF:-1 tvg-id=\""+chan_id_short+"\" tvg-logo=\""+chan_id_short+".png\" group-title=\""+bouq_name+"\", [COLOR gold]"+channel->getName()+"[/COLOR]\n";
result += "#EXTINF:-1 tvg-id=\""+chan_id_short+"\" tvg-logo=\""+NeutrinoAPI->getLogoFile(channel->getChannelID())+"\" group-title=\""+bouq_name+"\", [COLOR gold]"+channel->getName()+"[/COLOR]\n";
result += url+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID())+"\n";
}
}
@@ -3236,7 +3236,7 @@ void CControlAPI::logoCGI(CyhookHandler *hh)
sscanf(hh->ParamList["1"].c_str(),
SCANF_CHANNEL_ID_TYPE,
&channel_id);
hh->Write(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel_id));
hh->Write(NeutrinoAPI->getLogoFile(channel_id));
}
//-------------------------------------------------------------------------
/** Get Config File or save values to given config file

View File

@@ -26,6 +26,7 @@
#include <driver/fontrenderer.h>
#include <driver/rcinput.h>
#include <driver/screen_max.h>
#include <driver/pictureviewer/pictureviewer.h>
#include <gui/color.h>
#include <gui/widget/icons.h>
#include <gui/customcolor.h>
@@ -43,6 +44,7 @@
#include <eitd/sectionsd.h>
#include <OpenThreads/ScopedLock>
extern CPictureViewer *g_PicViewer;
extern CBouquetManager *g_bouquetManager;
extern CFrontend * frontend;
extern cVideo * videoDecoder;
@@ -521,24 +523,11 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void)
}
//-------------------------------------------------------------------------
std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channelId)
std::string CNeutrinoAPI::getLogoFile(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 + channelName + ".png").c_str(), 4) == 0)
return _logoURL + channelName + ".png";
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 if(access((_logoURL + channelIdAsString + ".png").c_str(), 4) == 0)
return _logoURL + channelIdAsString + ".png";
else 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
return "";
std::string logoString;
if (g_PicViewer->GetLogoName(channelId, channelName, logoString, NULL, NULL))
return logoString;
return "";
}

View File

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

View File

@@ -380,7 +380,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
yresult += "<tr>";
if (have_logos) {
std::string channel_logo = NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID());
std::string channel_logo = func_get_logo_name(hh, string_printf(PRINTF_CHANNEL_ID_TYPE, channel->getChannelID()));
std::string zaplink;
if (channel_logo.empty())
zaplink = channel->getName().c_str();
@@ -587,14 +587,33 @@ std::string CNeutrinoYParser::func_get_actual_channel_id(CyhookHandler *, std::
}
//-------------------------------------------------------------------------
// func: Get Logo Name
// func: Get logo name for Webif
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_get_logo_name(CyhookHandler *hh, std::string channelId)
{
if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true") {
t_channel_id cid;
if (1 == sscanf(channelId.c_str(), "%" PRIx64, &cid))
return NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], cid);
std::string LogosURL = hh->WebserverConfigList["Tuxbox.LogosURL"];
if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true" && !LogosURL.empty())
{
std::string fileType[] = { ".png", ".jpg" , ".gif" };
std::string channelIdShort = channelId.substr(channelId.length() - 12);
channelIdShort = channelIdShort.erase(0, min(channelIdShort.find_first_not_of('0'), channelIdShort.size()-1));
std::string channelName = "";
t_channel_id chId = 0;
if (sscanf(channelId.c_str(), "%" PRIx64, &chId) == 1)
channelName = NeutrinoAPI->GetServiceName(chId);
for (size_t i = 0; i < (sizeof(fileType) / sizeof(fileType[0])); i++)
{
// first check Tuxbox.LogosURL from nhttpd.conf
if (access((LogosURL + "/" + channelName + fileType[i]).c_str(), R_OK) == 0)
return LogosURL + "/" + channelName + fileType[i];
else if (access((LogosURL + "/" + channelIdShort + fileType[i]).c_str(), R_OK) == 0)
return LogosURL + "/" + channelIdShort + fileType[i];
else // fallback to default logos
return NeutrinoAPI->getLogoFile(chId);
}
}
return "";
}

View File

@@ -166,7 +166,7 @@ function get_timer(){
/* main */
var g_i = 0;
var g_bouquet_list;
var g_logosURL="";
var g_display_logos="";
function build_epg_plus(_bouquet, _starttime)
{
build_epg_clear();
@@ -200,7 +200,7 @@ function build_epg_plus_loop(_starttime, _stoptime)
var ep = $("epg_plus_container");
var __bdiv = obj_createAt(ep, "div", "ep_bouquet");
var __bname_div = obj_createAt(__bdiv, "div", "ep_bouquet_name");
var ch_name_with_logo= (g_logosURL!="")?"<img class=\"channel_logos\" src=\""+__logo+"\" title=\""+__channel_name+"\" alt=\""+__channel_name+"\" >":__channel_name;
var ch_name_with_logo= (g_display_logos=="true")?"<img class=\"channel_logos\" src=\""+__logo+"\" title=\""+__channel_name+"\" alt=\""+__channel_name+"\" >":__channel_name;
$(__bname_div).style.cssText = "width:"+c_width_px_bouquet+"px;";
$(__bname_div).update("<a href=\"javascript:do_zap('"+__channel_id+"');\">"+ch_name_with_logo+"</a>");
build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime, __logo);
@@ -257,8 +257,8 @@ function build_time_list(_delta){
}
}
/*init call*/
function epg_plus_init(_logosURL){
g_logosURL = _logosURL;
function epg_plus_init(_display_logos){
g_display_logos = _display_logos;
window.onresize=epg_plus_calc_dimensions;
build_time_list(0);
}

View File

@@ -68,7 +68,7 @@ function epg_imdb(){
</div>
<script type="text/javascript">
//<![CDATA[
epg_plus_init("{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL=}");
epg_plus_init("{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.DisplayLogos=}");
//]]>
</script>

View File

@@ -1,4 +1,4 @@
version=2.9.0.38
date=15.08.2016
version=2.9.0.39
date=26.08.2016
type=Release
info=Port CST