mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
controlapi: minor indentation/brackets fixes
Origin commit data
------------------
Branch: ni/coolstream
Commit: fdaaff4e11
Author: vanhofen <vanhofen@gmx.de>
Date: 2022-10-07 (Fri, 07 Oct 2022)
Origin message was:
------------------
- controlapi: minor indentation/brackets fixes
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -3548,14 +3548,17 @@ void CControlAPI::build_live_url(CyhookHandler *hh)
|
|||||||
if(!hh->ParamList["vlc_link"].empty())
|
if(!hh->ParamList["vlc_link"].empty())
|
||||||
{
|
{
|
||||||
write_to_file("/tmp/vlc.m3u", "#EXTM3U\n");
|
write_to_file("/tmp/vlc.m3u", "#EXTM3U\n");
|
||||||
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
|
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++)
|
||||||
|
{
|
||||||
ZapitChannelList chanlist;
|
ZapitChannelList chanlist;
|
||||||
if (mode == CZapitClient::MODE_RADIO)
|
if (mode == CZapitClient::MODE_RADIO)
|
||||||
g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist);
|
g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist);
|
||||||
else
|
else
|
||||||
g_bouquetManager->Bouquets[i]->getTvChannels(chanlist);
|
g_bouquetManager->Bouquets[i]->getTvChannels(chanlist);
|
||||||
if(!chanlist.empty() && !g_bouquetManager->Bouquets[i]->bHidden && g_bouquetManager->Bouquets[i]->bUser) {
|
if (!chanlist.empty() && !g_bouquetManager->Bouquets[i]->bHidden && g_bouquetManager->Bouquets[i]->bUser)
|
||||||
for(int j = 0; j < (int) chanlist.size(); j++) {
|
{
|
||||||
|
for (int j = 0; j < (int) chanlist.size(); j++)
|
||||||
|
{
|
||||||
CZapitChannel * channel = chanlist[j];
|
CZapitChannel * channel = chanlist[j];
|
||||||
//printf("---> %s/n",channel->getName().c_str());
|
//printf("---> %s/n",channel->getName().c_str());
|
||||||
write_to_file("/tmp/vlc.m3u", "#EXTINF:-1,"+channel->getName()+"\n",true);
|
write_to_file("/tmp/vlc.m3u", "#EXTINF:-1,"+channel->getName()+"\n",true);
|
||||||
@@ -3585,16 +3588,19 @@ void CControlAPI::build_playlist(CyhookHandler *hh)
|
|||||||
url += to_string(g_settings.streaming_port);
|
url += to_string(g_settings.streaming_port);
|
||||||
url += "/id=";
|
url += "/id=";
|
||||||
|
|
||||||
if(!hh->ParamList["id"].empty()) {
|
if (!hh->ParamList["id"].empty())
|
||||||
|
{
|
||||||
url += hh->ParamList["id"];
|
url += hh->ParamList["id"];
|
||||||
t_channel_id channel_id;
|
t_channel_id channel_id;
|
||||||
sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id);
|
sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id);
|
||||||
std::string chan_name = NeutrinoAPI->Zapit->getChannelName(channel_id);
|
std::string chan_name = NeutrinoAPI->Zapit->getChannelName(channel_id);
|
||||||
std::string illegalChars = "\\/:?\"<>|+ ";
|
std::string illegalChars = "\\/:?\"<>|+ ";
|
||||||
std::string::iterator it;
|
std::string::iterator it;
|
||||||
for (it = chan_name.begin() ; it < chan_name.end() ; ++it){
|
for (it = chan_name.begin() ; it < chan_name.end() ; ++it)
|
||||||
|
{
|
||||||
bool found = illegalChars.find(*it) != std::string::npos;
|
bool found = illegalChars.find(*it) != std::string::npos;
|
||||||
if(found){
|
if (found)
|
||||||
|
{
|
||||||
*it = '_';
|
*it = '_';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3603,7 +3609,8 @@ void CControlAPI::build_playlist(CyhookHandler *hh)
|
|||||||
write_to_file(m3u, "#EXTINF:-1," + NeutrinoAPI->Zapit->getChannelName(channel_id) + "\n", true);
|
write_to_file(m3u, "#EXTINF:-1," + NeutrinoAPI->Zapit->getChannelName(channel_id) + "\n", true);
|
||||||
write_to_file(m3u, url, true);
|
write_to_file(m3u, url, true);
|
||||||
hh->SendRedirect(m3u);
|
hh->SendRedirect(m3u);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
hh->SendError();
|
hh->SendError();
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user