- controlapi/epg: add fallback when no channel or bouquet is given

This function needs a fix, because "bouquetnr=all" breakes json output.
This commit is contained in:
svenhoefer
2016-02-24 16:42:21 +01:00
parent 72cec30e97
commit 911f333a7f

View File

@@ -1527,6 +1527,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) {
else if (!(hh->ParamList["channelname"].empty())) { else if (!(hh->ParamList["channelname"].empty())) {
channel_id = NeutrinoAPI->ChannelNameToChannelId(hh->ParamList["channelname"].c_str()); channel_id = NeutrinoAPI->ChannelNameToChannelId(hh->ParamList["channelname"].c_str());
} }
// or determine bouquetnr -> iterate the bouquet // or determine bouquetnr -> iterate the bouquet
int bouquetnr = -1; int bouquetnr = -1;
bool all_bouquets = false; bool all_bouquets = false;
@@ -1538,6 +1539,13 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) {
bouquetnr--; bouquetnr--;
} }
// fallback
if ((channel_id == (t_channel_id) -1) && (bouquetnr == -1))
{
channel_id = CZapit::getInstance()->GetCurrentChannelID();
//all_bouquets = true; //better, but broken
}
// ------ generate output ------ // ------ generate output ------
hh->outStart(true /*old mode*/); hh->outStart(true /*old mode*/);
std::string result = ""; std::string result = "";