nhttpd controlapi: allow zapping to subchannels

based on idea by Moritz Venn <moritz.venn@freaque.net>

Signed-off-by: Christian Schuett <Gaucho316@hotmail.com>
This commit is contained in:
Christian Schuett
2014-11-02 20:53:20 +01:00
committed by Jacek Jendrzej
parent 847b08aedb
commit 59ca850ecc
2 changed files with 30 additions and 1 deletions

View File

@@ -1653,7 +1653,9 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
CSectionsdClient::LinkageDescriptorList desc;
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo);
if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc))
if (currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors &&
CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey, desc))
{
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(current_channel);
t_satellite_position satellitePosition = channel->getSatellitePosition();
@@ -1669,6 +1671,19 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
}
}
}
else if (!hh->ParamList["subchannel"].empty())
{
t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID();
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo);
if (currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors)
{
NeutrinoAPI->ZapToSubService(hh->ParamList["subchannel"].c_str());
hh->SendOk();
}
else
hh->SendError();
}
else if (hh->ParamList["name"] != "")
{
t_channel_id channel_id;