mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
just indentation alignments; no other code changes
Origin commit data
------------------
Branch: ni/coolstream
Commit: 87ff6fcf0f
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-02-16 (Sun, 16 Feb 2020)
Origin message was:
------------------
- just indentation alignments; no other code changes
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -542,31 +542,29 @@ t_channel_id getepgid(std::string epg_name)
|
|||||||
|
|
||||||
CBouquetManager::ChannelIterator cit = g_bouquetManager->tvChannelsBegin();
|
CBouquetManager::ChannelIterator cit = g_bouquetManager->tvChannelsBegin();
|
||||||
|
|
||||||
// FIXME: Maybe there's a nicer solution
|
|
||||||
for (int m = CZapitClient::MODE_TV; m < CZapitClient::MODE_ALL; m++)
|
for (int m = CZapitClient::MODE_TV; m < CZapitClient::MODE_ALL; m++)
|
||||||
{
|
{
|
||||||
if (m == CZapitClient::MODE_RADIO)
|
if (m == CZapitClient::MODE_RADIO)
|
||||||
cit = g_bouquetManager->radioChannelsBegin();
|
cit = g_bouquetManager->radioChannelsBegin();
|
||||||
|
|
||||||
for (; !(cit.EndOfChannels()); cit++)
|
for (; !(cit.EndOfChannels()); cit++)
|
||||||
{
|
|
||||||
std::string tvg_id = (*cit)->getScriptName();
|
|
||||||
|
|
||||||
if (tvg_id.empty())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
std::size_t found = tvg_id.find("#"+epg_name);
|
|
||||||
if (found != std::string::npos)
|
|
||||||
{
|
{
|
||||||
tvg_id = tvg_id.substr(tvg_id.find_first_of("="));
|
std::string tvg_id = (*cit)->getScriptName();
|
||||||
sscanf(tvg_id.c_str(), "=%" SCNx64, &epgid);
|
|
||||||
return epgid;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // for m-loop
|
if (tvg_id.empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
std::size_t found = tvg_id.find("#"+epg_name);
|
||||||
|
if (found != std::string::npos)
|
||||||
|
{
|
||||||
|
tvg_id = tvg_id.substr(tvg_id.find_first_of("="));
|
||||||
|
sscanf(tvg_id.c_str(), "=%" SCNx64, &epgid);
|
||||||
|
return epgid;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -3265,57 +3265,55 @@ void CControlAPI::xmltvepgCGI(CyhookHandler *hh)
|
|||||||
{
|
{
|
||||||
g_bouquetManager->Bouquets[i]->getTvChannels(chanlist);
|
g_bouquetManager->Bouquets[i]->getTvChannels(chanlist);
|
||||||
|
|
||||||
// FIXME: Maybe there's a nicer solution
|
|
||||||
for (int m = CZapitClient::MODE_TV; m < CZapitClient::MODE_ALL; m++)
|
for (int m = CZapitClient::MODE_TV; m < CZapitClient::MODE_ALL; m++)
|
||||||
{
|
{
|
||||||
if (m == CZapitClient::MODE_RADIO)
|
if (m == CZapitClient::MODE_RADIO)
|
||||||
g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist);
|
g_bouquetManager->Bouquets[i]->getRadioChannels(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(unsigned int j = 0; j < chanlist.size(); j++)
|
|
||||||
{
|
{
|
||||||
CZapitChannel * channel = chanlist[j];
|
for(unsigned int j = 0; j < chanlist.size(); j++)
|
||||||
channel_id = channel->getChannelID() & 0xFFFFFFFFFFFFULL;
|
|
||||||
channelTag = "channel id=\""+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id)+"\"";
|
|
||||||
channelData = hh->outPair("display-name", hh->outValue(channel->getName(), xml_cdata), true);
|
|
||||||
result += hh->outObject(channelTag, channelData);
|
|
||||||
|
|
||||||
eList.clear();
|
|
||||||
|
|
||||||
CEitManager::getInstance()->getEventsServiceKey(channel_id, eList);
|
|
||||||
|
|
||||||
if (eList.size() == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (eList.size() > 50)
|
|
||||||
eList.erase(eList.begin()+50,eList.end());
|
|
||||||
|
|
||||||
for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator)
|
|
||||||
{
|
{
|
||||||
if (eventIterator->get_channel_id() == channel_id)
|
CZapitChannel * channel = chanlist[j];
|
||||||
|
channel_id = channel->getChannelID() & 0xFFFFFFFFFFFFULL;
|
||||||
|
channelTag = "channel id=\""+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id)+"\"";
|
||||||
|
channelData = hh->outPair("display-name", hh->outValue(channel->getName(), xml_cdata), true);
|
||||||
|
result += hh->outObject(channelTag, channelData);
|
||||||
|
|
||||||
|
eList.clear();
|
||||||
|
|
||||||
|
CEitManager::getInstance()->getEventsServiceKey(channel_id, eList);
|
||||||
|
|
||||||
|
if (eList.size() == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (eList.size() > 50)
|
||||||
|
eList.erase(eList.begin()+50,eList.end());
|
||||||
|
|
||||||
|
for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator)
|
||||||
{
|
{
|
||||||
programmeTag = "programme ";
|
if (eventIterator->get_channel_id() == channel_id)
|
||||||
programmeTag += "channel=\""+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id)+"\" ";
|
{
|
||||||
char zbuffer[25] = { 0 };
|
programmeTag = "programme ";
|
||||||
struct tm *mtime = gmtime(&eventIterator->startTime);
|
programmeTag += "channel=\""+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id)+"\" ";
|
||||||
strftime(zbuffer, 21, "%Y%m%d%H%M%S %z", mtime);
|
char zbuffer[25] = { 0 };
|
||||||
programmeTag += "start=\""+std::string(zbuffer)+"\" ";
|
struct tm *mtime = gmtime(&eventIterator->startTime);
|
||||||
long _stoptime = eventIterator->startTime + eventIterator->duration;
|
strftime(zbuffer, 21, "%Y%m%d%H%M%S %z", mtime);
|
||||||
mtime = gmtime(&_stoptime);
|
programmeTag += "start=\""+std::string(zbuffer)+"\" ";
|
||||||
strftime(zbuffer, 21, "%Y%m%d%H%M%S %z", mtime);
|
long _stoptime = eventIterator->startTime + eventIterator->duration;
|
||||||
programmeTag += "stop=\""+std::string(zbuffer)+"\" ";
|
mtime = gmtime(&_stoptime);
|
||||||
|
strftime(zbuffer, 21, "%Y%m%d%H%M%S %z", mtime);
|
||||||
|
programmeTag += "stop=\""+std::string(zbuffer)+"\" ";
|
||||||
|
|
||||||
programmeData = hh->outPair("title lang=\"de\"", hh->outValue(eventIterator->description, xml_cdata), false);
|
programmeData = hh->outPair("title lang=\"de\"", hh->outValue(eventIterator->description, xml_cdata), false);
|
||||||
programmeData += hh->outPair("desc lang=\"de\"", hh->outValue(eventIterator->text, xml_cdata), true);
|
programmeData += hh->outPair("desc lang=\"de\"", hh->outValue(eventIterator->text, xml_cdata), true);
|
||||||
|
|
||||||
result += hh->outArrayItem(programmeTag, programmeData, false);
|
result += hh->outArrayItem(programmeTag, programmeData, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // for m-loop
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result = hh->outObject("tv generator-info-name=\"Neutrino XMLTV Generator v1.0\"", result);
|
result = hh->outObject("tv generator-info-name=\"Neutrino XMLTV Generator v1.0\"", result);
|
||||||
@@ -3358,7 +3356,6 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh)
|
|||||||
{
|
{
|
||||||
ZapitChannelList chanlist;
|
ZapitChannelList chanlist;
|
||||||
|
|
||||||
// FIXME: Maybe there's a nicer solution
|
|
||||||
for (int m = CZapitClient::MODE_TV; m < CZapitClient::MODE_ALL; m++)
|
for (int m = CZapitClient::MODE_TV; m < CZapitClient::MODE_ALL; m++)
|
||||||
{
|
{
|
||||||
if (mode == CZapitClient::MODE_RADIO || m == CZapitClient::MODE_RADIO)
|
if (mode == CZapitClient::MODE_RADIO || m == CZapitClient::MODE_RADIO)
|
||||||
@@ -3366,33 +3363,33 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh)
|
|||||||
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 (unsigned int j = 0; j < chanlist.size(); j++)
|
|
||||||
{
|
{
|
||||||
CZapitChannel *channel = chanlist[j];
|
for (unsigned int j = 0; j < chanlist.size(); 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);
|
CZapitChannel *channel = chanlist[j];
|
||||||
result += "#EXTINF:-1 tvg-id=\"" + chan_id_short + "\"";
|
std::string bouq_name = g_bouquetManager->Bouquets[i]->bName;
|
||||||
result += " tvg-name=\"" + channel->getName() + "\"";
|
std::string chan_id_short = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL);
|
||||||
if (!NeutrinoAPI->getLogoFile(channel->getChannelID()).empty())
|
result += "#EXTINF:-1 tvg-id=\"" + chan_id_short + "\"";
|
||||||
result += " tvg-logo=\"" + host + NeutrinoAPI->getLogoFile(channel->getChannelID()) + "\"";
|
result += " tvg-name=\"" + channel->getName() + "\"";
|
||||||
else
|
if (!NeutrinoAPI->getLogoFile(channel->getChannelID()).empty())
|
||||||
result += " tvg-logo=\"\"";
|
result += " tvg-logo=\"" + host + NeutrinoAPI->getLogoFile(channel->getChannelID()) + "\"";
|
||||||
if (mode == CZapitClient::MODE_RADIO || m == CZapitClient::MODE_RADIO)
|
else
|
||||||
result += " radio=\"true\"";
|
result += " tvg-logo=\"\"";
|
||||||
else
|
if (mode == CZapitClient::MODE_RADIO || m == CZapitClient::MODE_RADIO)
|
||||||
result += " radio=\"\"";
|
result += " radio=\"true\"";
|
||||||
result += " group-prefix=\"" + std::string(hostname) + "\"";
|
else
|
||||||
result += " group-title=\"" + bouq_name + "\",";
|
result += " radio=\"\"";
|
||||||
result += channel->getName() + "\n";
|
result += " group-prefix=\"" + std::string(hostname) + "\"";
|
||||||
result += url + string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()) + "\n";
|
result += " group-title=\"" + bouq_name + "\",";
|
||||||
|
result += channel->getName() + "\n";
|
||||||
|
result += url + string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()) + "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (mode != CZapitClient::MODE_ALL)
|
if (mode != CZapitClient::MODE_ALL)
|
||||||
break;
|
break;
|
||||||
} // for m-loop
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hh->SendResult(result);
|
hh->SendResult(result);
|
||||||
|
Reference in New Issue
Block a user