From cb4b093b11c0a0e989d2ea50e62705db08ccdb1c Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 11 Mar 2014 19:49:37 +0100 Subject: [PATCH 1/5] nhttpd/neutrinoapi: fix getLogoFile() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b66c1e9f0fd7a40f55f626f61f4c2716cdaa454d Author: martii Date: 2014-03-11 (Tue, 11 Mar 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index f0a30f604..d0696069e 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,7 @@ #include #include +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(std::string _logoURL __attribute__((unused)), 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 ""; } From 58a479dc923fe7edd55684d2984517b8304f857b Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 25 Aug 2016 11:37:20 +0200 Subject: [PATCH 2/5] fix xmltv channellogos Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3f3ff32c8631d521ecd8d8f2df6c9911a207dece Author: TangoCash Date: 2016-08-25 (Thu, 25 Aug 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index ccf614601..22fc5fa2d 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3142,7 +3142,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"; } } From 27da45f59e61f19caf23e5dd68a15f108cf2d417 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 26 Aug 2016 15:00:14 +0200 Subject: [PATCH 3/5] neutrinoyparser: move search for channellogos to neutrinoyparser This is to respecting user's setting to use other channellogos for WebIf. Now WebIf tries Tuxbox.LogosURL from nhttpd.conf first. Controlapi ignores these setting and providing the default system channelogos using NeutrinoAPI->getLogoFile(). Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7ac0ed9093028276834dbfe6fbcd217318497676 Author: vanhofen Date: 2016-08-26 (Fri, 26 Aug 2016) Origin message was: ------------------ - neutrinoyparser: move search for channellogos to neutrinoyparser This is to respecting user's setting to use other channellogos for WebIf. Now WebIf tries Tuxbox.LogosURL from nhttpd.conf first. Controlapi ignores these setting and providing the default system channelogos using NeutrinoAPI->getLogoFile(). ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 31 +++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 0b713d901..f2a1fb2ad 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -368,7 +368,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: yresult += ""; 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(); @@ -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) { - 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 ""; } From 3f71bf4b1f303fd5a91fa3e175422d848b52719e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 26 Aug 2016 15:14:09 +0200 Subject: [PATCH 4/5] tuxboxapi: remove obsolete Tuxbox.LogosURL from getLogoFile() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3e283469dbd290c9c5e8a9f61782dd7ae7aa6bd5 Author: vanhofen Date: 2016-08-26 (Fri, 26 Aug 2016) Origin message was: ------------------ - tuxboxapi: remove obsolete Tuxbox.LogosURL from getLogoFile() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 6 +++--- src/nhttpd/tuxboxapi/neutrinoapi.cpp | 2 +- src/nhttpd/tuxboxapi/neutrinoapi.h | 2 +- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 22fc5fa2d..d1bc6b106 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -1114,7 +1114,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(); @@ -3142,7 +3142,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=\""+NeutrinoAPI->getLogoFile("",channel->getChannelID())+"\" 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"; } } @@ -3223,7 +3223,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 diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index d0696069e..baceef32d 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -523,7 +523,7 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void) } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getLogoFile(std::string _logoURL __attribute__((unused)), t_channel_id channelId) +std::string CNeutrinoAPI::getLogoFile(t_channel_id channelId) { std::string channelName = GetServiceName(channelId); std::string logoString; diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 1685d5874..82c9abbf3 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -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); diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index f2a1fb2ad..fbc620122 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -600,7 +600,7 @@ std::string CNeutrinoYParser::func_get_logo_name(CyhookHandler *hh, std::string 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 NeutrinoAPI->getLogoFile(chId); } } return ""; From 7b820b8ceff725ee7bd8cc977040a3c504c0cd6c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 26 Aug 2016 15:56:11 +0200 Subject: [PATCH 5/5] yWeb: depending display of logos in EPG plus from Tuxbox.DisplayLogos Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7d580b32967bdd61a34803fc3c12ba1a17c60a6a Author: vanhofen Date: 2016-08-26 (Fri, 26 Aug 2016) Origin message was: ------------------ - yWeb: depending display of logos in EPG plus from Tuxbox.DisplayLogos ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_EPG.js | 8 ++++---- src/nhttpd/web/Y_EPG_Plus.yhtm | 2 +- src/nhttpd/web/Y_Version.txt | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nhttpd/web/Y_EPG.js b/src/nhttpd/web/Y_EPG.js index 7a7f15368..f3d3ebd96 100644 --- a/src/nhttpd/web/Y_EPG.js +++ b/src/nhttpd/web/Y_EPG.js @@ -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!="")?"\""+__channel_name+"\"":__channel_name; + var ch_name_with_logo= (g_display_logos=="true")?"\""+__channel_name+"\"":__channel_name; $(__bname_div).style.cssText = "width:"+c_width_px_bouquet+"px;"; $(__bname_div).update(""+ch_name_with_logo+""); 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); } diff --git a/src/nhttpd/web/Y_EPG_Plus.yhtm b/src/nhttpd/web/Y_EPG_Plus.yhtm index b6888235c..a49808f9b 100644 --- a/src/nhttpd/web/Y_EPG_Plus.yhtm +++ b/src/nhttpd/web/Y_EPG_Plus.yhtm @@ -67,7 +67,7 @@ function epg_imdb(){ diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index c4da80e3a..89d2ca789 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -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