getBouquet fix events

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1681 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 2d7b016434
Author: yjogol <yjogol2@online.de>
Date: 2011-09-09 (Fri, 09 Sep 2011)



------------------
This commit was generated by Migit
This commit is contained in:
yjogol
2011-09-09 08:30:50 +00:00
parent 1115d969c1
commit 09c33792a0

View File

@@ -878,21 +878,16 @@ void CControlAPI::ChannellistCGI(CyhookHandler *hh)
std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) {
std::string result, firstEPG, secondEPG = "";
t_channel_id current_channel = live_channel_id;
int percentage;
int percentage = 100;
std::string timestr;
// NeutrinoAPI->GetChannelEvents();
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
CChannelEvent *event;
event = NeutrinoAPI->ChannelListEvents[channel->channel_id];
/* timer slider */
if (event && event->duration > 0)
if (event) {
if (event->duration > 0)
percentage = 100 * (time(NULL) - event->startTime) / event->duration;
else
percentage = 100;
if ((event = NeutrinoAPI->ChannelListEvents[channel->channel_id])) {
sectionsd_getCurrentNextServiceKey(channel->channel_id & 0xFFFFFFFFFFFFULL, currentNextInfo);
timestr = timeString(event->startTime);
@@ -1050,19 +1045,7 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) {
startBouquet = BouquetNr;
bsize = BouquetNr+1;
}
/* channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[BouquetNr]->radioChannels : g_bouquetManager->Bouquets[BouquetNr]->tvChannels;
int num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr)
: g_bouquetManager->tvChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr));
for (int j = 0, size = (int) (channels.size()); j < size; j++) {
CZapitChannel * channel = channels[j];
result += _GetBouquetWriteItem(hh, channel, BouquetNr, num + j);
if (j < (size - 1) && outType == json) {
result += ",\n";
}
}
}
else {
*/ // list all
NeutrinoAPI->GetChannelEvents();
for (int i = startBouquet; i < bsize; i++) {
channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[i]->radioChannels : g_bouquetManager->Bouquets[i]->tvChannels;
int num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(i)
@@ -1079,7 +1062,6 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) {
result += ",\n";
}
}
// }
result = hh->outArray("channels", result);
// write footer
if (outType == json) {