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

@@ -797,6 +797,20 @@ ok<br>
&gt;&gt;&gt;http://dbox/control/setmode?record=stop<br>
ok<br>
</div>
<br>
<b>Parameter:</b> subchannel=&lt;channel_id&gt; (64 bit, hexidecimal value)<br>
<b>Rueckgabe:</b><br>
<br>
Zappt auf den angegebenen Unterkanal.<br>
Als Rueckgabe ist im Erfolgsfall ok zu erwarten.<br>
<br>
<b>Rueckgabe-Format:</b> ok / error<br>
<div class="example">
Beispiel:<br>
<br>
&gt;&gt;&gt;http://dbox/control/zapto?subchannel=1008500d4<br>
ok <br>
</div>
<!-- ----------------------------------------------------------- -->
<div class="title1"><a name="getmode"></a>8. Radio/TV Mode Abfrage</div>

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;