From e3d609759dc2273d741791f379d29bbf05f03faf Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 9 Sep 2018 13:26:51 +0200 Subject: [PATCH] - controlapi: minor changes in url creation in xmltvm3uCGI() function Signed-off-by: Thilo Graf --- src/nhttpd/tuxboxapi/controlapi.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index ee9178d7a..7d74a710f 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3294,14 +3294,15 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh) std::string result = ""; int mode = NeutrinoAPI->Zapit->getMode(); - // build url - std::string url = ""; - if (!hh->ParamList["host"].empty()) - url = "http://" + hh->ParamList["host"]; - else - url = "http://" + hh->HeaderList["Host"]; - std::string lurl = url; + std::string host = ""; + if (!hh->ParamList["host"].empty()) + host = "http://" + hh->ParamList["host"]; + else + host = "http://" + hh->HeaderList["Host"]; + + // build url + std::string url = host; /* strip off optional custom port */ if (url.rfind(":") != 4) url = url.substr(0, url.rfind(":")); @@ -3324,7 +3325,7 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh) CZapitChannel *channel = chanlist[j]; std::string bouq_name = g_bouquetManager->Bouquets[i]->bName; 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=\"" + lurl + NeutrinoAPI->getLogoFile(channel->getChannelID()) + "\" group-title=\"" + bouq_name + "\"," + channel->getName() + "\n"; + result += "#EXTINF:-1 tvg-id=\"" + chan_id_short + "\" tvg-logo=\"" + host + NeutrinoAPI->getLogoFile(channel->getChannelID()) + "\" group-title=\"" + bouq_name + "\"," + channel->getName() + "\n"; result += url + string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()) + "\n"; } }