diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index fd939cc57..ee9178d7a 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -3290,47 +3290,47 @@ void CControlAPI::xmltvepgCGI(CyhookHandler *hh) void CControlAPI::xmltvm3uCGI(CyhookHandler *hh) { - hh->outStart(); - std::string result = ""; + hh->outStart(); + 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"]; + 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; - /* strip off optional custom port */ - if (url.rfind(":") != 4) - url = url.substr(0, url.rfind(":")); + /* strip off optional custom port */ + if (url.rfind(":") != 4) + url = url.substr(0, url.rfind(":")); - url += ":31339/id="; + url += ":31339/id="; - result += "#EXTM3U\n"; + result += "#EXTM3U\n"; - for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) - { - ZapitChannelList chanlist; - if (mode == CZapitClient::MODE_RADIO) - g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist); - else - g_bouquetManager->Bouquets[i]->getTvChannels(chanlist); - if(!chanlist.empty() && !g_bouquetManager->Bouquets[i]->bHidden && g_bouquetManager->Bouquets[i]->bUser) - { - for(int j = 0; j < (int) chanlist.size(); j++) - { - CZapitChannel * channel = chanlist[j]; + for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) + { + ZapitChannelList chanlist; + if (mode == CZapitClient::MODE_RADIO) + g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist); + else + g_bouquetManager->Bouquets[i]->getTvChannels(chanlist); + if (!chanlist.empty() && !g_bouquetManager->Bouquets[i]->bHidden && g_bouquetManager->Bouquets[i]->bUser) + { + for (int j = 0; j < (int) chanlist.size(); j++) + { + 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 += url+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID())+"\n"; - } - } - } + result += "#EXTINF:-1 tvg-id=\"" + chan_id_short + "\" tvg-logo=\"" + lurl + 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"; + } + } + } - hh->SendResult(result); + hh->SendResult(result); } //------------------------------------------------------------------------- // audio_no : (optional) audio channel