mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +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
------------------
Commit: 3498c8c8a6
Author: BPanther <bpanther_ts@hotmail.com>
Date: 2024-04-30 (Tue, 30 Apr 2024)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -207,6 +207,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
|||||||
{"signal", &CControlAPI::SignalInfoCGI, "text/plain"},
|
{"signal", &CControlAPI::SignalInfoCGI, "text/plain"},
|
||||||
{"getonidsid", &CControlAPI::GetChannelIDCGI, "text/plain"},
|
{"getonidsid", &CControlAPI::GetChannelIDCGI, "text/plain"},
|
||||||
{"getchannelid", &CControlAPI::GetChannelIDCGI, ""},
|
{"getchannelid", &CControlAPI::GetChannelIDCGI, ""},
|
||||||
|
{"getchannelinfo", &CControlAPI::GetChannelInfoCGI, ""},
|
||||||
{"getepgid", &CControlAPI::GetEpgIDCGI, ""},
|
{"getepgid", &CControlAPI::GetEpgIDCGI, ""},
|
||||||
{"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"},
|
{"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"},
|
||||||
// boxcontrol - system
|
// boxcontrol - system
|
||||||
@@ -762,6 +763,37 @@ void CControlAPI::GetChannelIDCGI(CyhookHandler *hh)
|
|||||||
hh->SendResult(result);
|
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
|
/** Display epg id's
|
||||||
* @param hh CyhookHandler
|
* @param hh CyhookHandler
|
||||||
|
@@ -87,6 +87,7 @@ private:
|
|||||||
void GetBouquetsxmlCGI(CyhookHandler *hh);
|
void GetBouquetsxmlCGI(CyhookHandler *hh);
|
||||||
void GetUBouquetsxmlCGI(CyhookHandler *hh);
|
void GetUBouquetsxmlCGI(CyhookHandler *hh);
|
||||||
void GetChannelIDCGI(CyhookHandler *hh);
|
void GetChannelIDCGI(CyhookHandler *hh);
|
||||||
|
void GetChannelInfoCGI(CyhookHandler *hh);
|
||||||
void GetEpgIDCGI(CyhookHandler *hh);
|
void GetEpgIDCGI(CyhookHandler *hh);
|
||||||
void GetTPChannel_IDCGI(CyhookHandler *hh);
|
void GetTPChannel_IDCGI(CyhookHandler *hh);
|
||||||
void MessageCGI(CyhookHandler *hh);
|
void MessageCGI(CyhookHandler *hh);
|
||||||
|
Reference in New Issue
Block a user