mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +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;
|
fav = true;
|
||||||
|
|
||||||
int mode = NeutrinoAPI->Zapit->getMode();
|
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;
|
mode = CZapitClient::MODE_TV;
|
||||||
else if (hh->ParamList["mode"].compare("RADIO") == 0)
|
else if (hh->ParamList["mode"].compare("RADIO") == 0)
|
||||||
mode = CZapitClient::MODE_RADIO;
|
mode = CZapitClient::MODE_RADIO;
|
||||||
@@ -1101,8 +1103,18 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) {
|
|||||||
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;
|
unsigned int channel_count = 0;
|
||||||
if (!channels->empty() && (!g_bouquetManager->Bouquets[i]->bHidden || show_hidden) && (!fav || g_bouquetManager->Bouquets[i]->bUser)) {
|
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());
|
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
|
||||||
|
@@ -104,7 +104,8 @@ class CZapitClient:public CBasicClient
|
|||||||
{
|
{
|
||||||
MODE_CURRENT,
|
MODE_CURRENT,
|
||||||
MODE_TV,
|
MODE_TV,
|
||||||
MODE_RADIO
|
MODE_RADIO,
|
||||||
|
MODE_ALL
|
||||||
} channelsMode;
|
} channelsMode;
|
||||||
|
|
||||||
typedef enum channelsOrder_
|
typedef enum channelsOrder_
|
||||||
|
Reference in New Issue
Block a user