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

This function needs a fix, because "bouquetnr=all" breakes json output.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 911f333a7f
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-02-24 (Wed, 24 Feb 2016)

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

This function needs a fix, because "bouquetnr=all" breakes json output.


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2016-02-24 16:42:21 +01:00
parent 2c9f54f9b1
commit 72ca399341

View File

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