mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
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:
@@ -878,21 +878,16 @@ void CControlAPI::ChannellistCGI(CyhookHandler *hh)
|
|||||||
std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) {
|
std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) {
|
||||||
std::string result, firstEPG, secondEPG = "";
|
std::string result, firstEPG, secondEPG = "";
|
||||||
t_channel_id current_channel = live_channel_id;
|
t_channel_id current_channel = live_channel_id;
|
||||||
int percentage;
|
int percentage = 100;
|
||||||
std::string timestr;
|
std::string timestr;
|
||||||
|
|
||||||
// NeutrinoAPI->GetChannelEvents();
|
|
||||||
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
|
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
|
||||||
CChannelEvent *event;
|
CChannelEvent *event;
|
||||||
event = NeutrinoAPI->ChannelListEvents[channel->channel_id];
|
event = NeutrinoAPI->ChannelListEvents[channel->channel_id];
|
||||||
|
|
||||||
/* timer slider */
|
if (event) {
|
||||||
if (event && event->duration > 0)
|
if (event->duration > 0)
|
||||||
percentage = 100 * (time(NULL) - event->startTime) / event->duration;
|
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);
|
sectionsd_getCurrentNextServiceKey(channel->channel_id & 0xFFFFFFFFFFFFULL, currentNextInfo);
|
||||||
timestr = timeString(event->startTime);
|
timestr = timeString(event->startTime);
|
||||||
|
|
||||||
@@ -1050,36 +1045,23 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) {
|
|||||||
startBouquet = BouquetNr;
|
startBouquet = BouquetNr;
|
||||||
bsize = BouquetNr+1;
|
bsize = BouquetNr+1;
|
||||||
}
|
}
|
||||||
/* channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[BouquetNr]->radioChannels : g_bouquetManager->Bouquets[BouquetNr]->tvChannels;
|
NeutrinoAPI->GetChannelEvents();
|
||||||
int num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr)
|
for (int i = startBouquet; i < bsize; i++) {
|
||||||
: g_bouquetManager->tvChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr));
|
channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[i]->radioChannels : g_bouquetManager->Bouquets[i]->tvChannels;
|
||||||
for (int j = 0, size = (int) (channels.size()); j < size; j++) {
|
int num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(i)
|
||||||
|
: g_bouquetManager->tvChannelsBegin().getNrofFirstChannelofBouquet(i));
|
||||||
|
int size = (int) channels.size();
|
||||||
|
for (int j = 0; j < size; j++) {
|
||||||
CZapitChannel * channel = channels[j];
|
CZapitChannel * channel = channels[j];
|
||||||
result += _GetBouquetWriteItem(hh, channel, BouquetNr, num + j);
|
result += _GetBouquetWriteItem(hh, channel, i, num + j);
|
||||||
if (j < (size - 1) && outType == json) {
|
if (j < (size - 1) && outType == json) {
|
||||||
result += ",\n";
|
result += ",\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (i < (bsize - 1) && outType == json && size > 0) {
|
||||||
else {
|
result += ",\n";
|
||||||
*/ // list all
|
|
||||||
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)
|
|
||||||
: g_bouquetManager->tvChannelsBegin().getNrofFirstChannelofBouquet(i));
|
|
||||||
int size = (int) channels.size();
|
|
||||||
for (int j = 0; j < size; j++) {
|
|
||||||
CZapitChannel * channel = channels[j];
|
|
||||||
result += _GetBouquetWriteItem(hh, channel, i, num + j);
|
|
||||||
if (j < (size - 1) && outType == json) {
|
|
||||||
result += ",\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (i < (bsize - 1) && outType == json && size > 0) {
|
|
||||||
result += ",\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
result = hh->outArray("channels", result);
|
result = hh->outArray("channels", result);
|
||||||
// write footer
|
// write footer
|
||||||
if (outType == json) {
|
if (outType == json) {
|
||||||
|
Reference in New Issue
Block a user