mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
nhttpd/controlapi: GetBouquetsCGI: support "mode=all" (compiles, untested)
This commit is contained in:
@@ -1093,7 +1093,9 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) {
|
||||
fav = true;
|
||||
|
||||
int mode = NeutrinoAPI->Zapit->getMode();
|
||||
if (hh->ParamList["mode"].compare("TV") == 0)
|
||||
if (hh->ParamList["mode"].compare("all") == 0)
|
||||
mode = CZapitClient::MODE_ALL;
|
||||
else if (hh->ParamList["mode"].compare("TV") == 0)
|
||||
mode = CZapitClient::MODE_TV;
|
||||
else if (hh->ParamList["mode"].compare("RADIO") == 0)
|
||||
mode = CZapitClient::MODE_RADIO;
|
||||
@@ -1101,8 +1103,18 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) {
|
||||
std::string bouquet;
|
||||
for (int i = 0, size = (int) g_bouquetManager->Bouquets.size(); i < size; i++) {
|
||||
std::string item = "";
|
||||
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) && (!fav || g_bouquetManager->Bouquets[i]->bUser)) {
|
||||
unsigned int channel_count = 0;
|
||||
switch (mode) {
|
||||
case CZapitClient::MODE_RADIO:
|
||||
channel_count = g_bouquetManager->Bouquets[i]->radioChannels.size();
|
||||
break;
|
||||
case CZapitClient::MODE_TV:
|
||||
channel_count = g_bouquetManager->Bouquets[i]->tvChannels.size();
|
||||
break;
|
||||
case CZapitClient::MODE_ALL:
|
||||
channel_count = g_bouquetManager->Bouquets[i]->radioChannels.size() + g_bouquetManager->Bouquets[i]->tvChannels.size();
|
||||
}
|
||||
if (channel_count && (!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());
|
||||
if (encode)
|
||||
bouquet = encodeString(bouquet); // encode (URLencode) the bouquetname
|
||||
|
Reference in New Issue
Block a user