mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
nhttpd/tuxboxapi/coolstream/controlapi.cpp: call GetChannelEvents only if epg param present,
add 'fav' param to get only user bouquets; add support to get bouquet's channel list with epg also in plain format
This commit is contained in:
@@ -960,12 +960,24 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel *
|
|||||||
result = hh->outArrayItem("channel", result, false);
|
result = hh->outArrayItem("channel", result, false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result += string_printf("%u "
|
CChannelEvent *event;
|
||||||
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
event = NeutrinoAPI->ChannelListEvents[channel->channel_id];
|
||||||
" %s\n",
|
|
||||||
nr,
|
if (event && isEPGdetails) {
|
||||||
channel->channel_id,
|
result += string_printf("%u "
|
||||||
channel->getName().c_str());
|
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||||
|
" %s (%s)\n",
|
||||||
|
nr,
|
||||||
|
channel->channel_id,
|
||||||
|
channel->getName().c_str(), event->description.c_str());
|
||||||
|
} else {
|
||||||
|
result += string_printf("%u "
|
||||||
|
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||||
|
" %s\n",
|
||||||
|
nr,
|
||||||
|
channel->channel_id,
|
||||||
|
channel->getName().c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1073,7 +1085,8 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) {
|
|||||||
startBouquet = BouquetNr;
|
startBouquet = BouquetNr;
|
||||||
bsize = BouquetNr+1;
|
bsize = BouquetNr+1;
|
||||||
}
|
}
|
||||||
NeutrinoAPI->GetChannelEvents();
|
if (!(hh->ParamList["epg"].empty()))
|
||||||
|
NeutrinoAPI->GetChannelEvents();
|
||||||
for (int i = startBouquet; i < bsize; i++) {
|
for (int i = startBouquet; i < bsize; i++) {
|
||||||
channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[i]->radioChannels : g_bouquetManager->Bouquets[i]->tvChannels;
|
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)
|
int num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(i)
|
||||||
@@ -1185,12 +1198,16 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) {
|
|||||||
if (hh->ParamList["encode"] == "true")
|
if (hh->ParamList["encode"] == "true")
|
||||||
encode = true;
|
encode = true;
|
||||||
|
|
||||||
|
bool fav = false;
|
||||||
|
if (hh->ParamList["fav"] == "true")
|
||||||
|
fav = true;
|
||||||
|
|
||||||
int mode = NeutrinoAPI->Zapit->getMode();
|
int mode = NeutrinoAPI->Zapit->getMode();
|
||||||
std::string bouquet;
|
std::string bouquet;
|
||||||
for (int i = 0, size = (int) g_bouquetManager->Bouquets.size(); i < size; i++) {
|
for (int i = 0, size = (int) g_bouquetManager->Bouquets.size(); i < size; i++) {
|
||||||
std::string item = "";
|
std::string item = "";
|
||||||
ZapitChannelList * channels = mode == CZapitClient::MODE_RADIO ? &g_bouquetManager->Bouquets[i]->radioChannels : &g_bouquetManager->Bouquets[i]->tvChannels;
|
ZapitChannelList * channels = mode == CZapitClient::MODE_RADIO ? &g_bouquetManager->Bouquets[i]->radioChannels : &g_bouquetManager->Bouquets[i]->tvChannels;
|
||||||
if (!channels->empty() && (!g_bouquetManager->Bouquets[i]->bHidden || show_hidden)) {
|
if (!channels->empty() && (!g_bouquetManager->Bouquets[i]->bHidden || show_hidden) && (!fav || g_bouquetManager->Bouquets[i]->bUser)) {
|
||||||
bouquet = std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[i]->Name.c_str());
|
bouquet = std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[i]->Name.c_str());
|
||||||
if (encode)
|
if (encode)
|
||||||
bouquet = encodeString(bouquet); // encode (URLencode) the bouquetname
|
bouquet = encodeString(bouquet); // encode (URLencode) the bouquetname
|
||||||
|
Reference in New Issue
Block a user