mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
yWeb: /control/getchannelinfo for short channel info added.
Line 1: servicename
Line 2: epg info
Line 3: duration X/Y
Origin commit data
------------------
Branch: ni/coolstream
Commit: b24077eeb9
Author: BPanther <bpanther_ts@hotmail.com>
Date: 2024-05-03 (Fri, 03 May 2024)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -213,6 +213,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
||||
{"signal", &CControlAPI::SignalInfoCGI, "text/plain"},
|
||||
{"getonidsid", &CControlAPI::GetChannelIDCGI, "text/plain"},
|
||||
{"getchannelid", &CControlAPI::GetChannelIDCGI, ""},
|
||||
{"getchannelinfo", &CControlAPI::GetChannelInfoCGI, ""},
|
||||
{"getepgid", &CControlAPI::GetEpgIDCGI, ""},
|
||||
{"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"},
|
||||
// boxcontrol - system
|
||||
@@ -771,6 +772,37 @@ void CControlAPI::GetChannelIDCGI(CyhookHandler *hh)
|
||||
hh->SendResult(result);
|
||||
}
|
||||
|
||||
// get actual channel_info
|
||||
void CControlAPI::GetChannelInfoCGI(CyhookHandler *hh)
|
||||
{
|
||||
t_channel_id channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
||||
CZapitChannel *channel = CServiceManager::getInstance()->FindChannel48(channel_id);
|
||||
|
||||
hh->outStart();
|
||||
std::string result = "";
|
||||
result = hh->outObject("name", hh->outValue(channel->getName()) + "\n");
|
||||
|
||||
CShortEPGData epg;
|
||||
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
|
||||
CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo);
|
||||
|
||||
if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg))
|
||||
{
|
||||
result += hh->outObject("title", hh->outValue(epg.title) + "\n");
|
||||
}
|
||||
|
||||
CChannelEvent event;
|
||||
NeutrinoAPI->GetChannelEvents();
|
||||
NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event);
|
||||
|
||||
if (event.eventID)
|
||||
{
|
||||
result += hh->outObject("duration", string_printf("%d/", (time(NULL) - event.startTime) / 60) + string_printf("%d\n", event.duration / 60));
|
||||
}
|
||||
|
||||
hh->SendResult(result);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
/** Display epg id's
|
||||
* @param hh CyhookHandler
|
||||
|
Reference in New Issue
Block a user