Merge branch 'cst-next' into nmp-cst-next_test

Origin commit data
------------------
Branch: ni/coolstream
Commit: f162708f6a
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
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:
Michael Liebmann
2016-08-26 16:52:10 +02:00
7 changed files with 43 additions and 35 deletions

View File

@@ -1120,7 +1120,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("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("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("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) if (bouquetNr > -1)
{ {
result += hh->outNext(); result += hh->outNext();
@@ -3150,7 +3150,7 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh)
CZapitChannel * channel = chanlist[j]; CZapitChannel * channel = chanlist[j];
std::string bouq_name = g_bouquetManager->Bouquets[i]->Name; 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); 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"; result += url+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID())+"\n";
} }
} }
@@ -3231,7 +3231,7 @@ void CControlAPI::logoCGI(CyhookHandler *hh)
sscanf(hh->ParamList["1"].c_str(), sscanf(hh->ParamList["1"].c_str(),
SCANF_CHANNEL_ID_TYPE, SCANF_CHANNEL_ID_TYPE,
&channel_id); &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 /** Get Config File or save values to given config file

View File

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

View File

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

View File

@@ -368,7 +368,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
yresult += "<tr>"; yresult += "<tr>";
if (have_logos) { 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; std::string zaplink;
if (channel_logo.empty()) if (channel_logo.empty())
zaplink = channel->getName().c_str(); zaplink = channel->getName().c_str();
@@ -575,14 +575,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) std::string CNeutrinoYParser::func_get_logo_name(CyhookHandler *hh, std::string channelId)
{ {
if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true") { std::string LogosURL = hh->WebserverConfigList["Tuxbox.LogosURL"];
t_channel_id cid; if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true" && !LogosURL.empty())
if (1 == sscanf(channelId.c_str(), "%" PRIx64, &cid)) {
return NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], cid); 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 ""; return "";
} }

View File

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

View File

@@ -67,7 +67,7 @@ function epg_imdb(){
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![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> </script>

View File

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