diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index d05f5cd0c..ce642aa2b 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -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 diff --git a/src/zapit/include/zapit/client/zapitclient.h b/src/zapit/include/zapit/client/zapitclient.h index 3a166553c..c25cdd751 100644 --- a/src/zapit/include/zapit/client/zapitclient.h +++ b/src/zapit/include/zapit/client/zapitclient.h @@ -104,7 +104,8 @@ class CZapitClient:public CBasicClient { MODE_CURRENT, MODE_TV, - MODE_RADIO + MODE_RADIO, + MODE_ALL } channelsMode; typedef enum channelsOrder_