mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
add simple Webif for WebTV WebRadio and xmltv
Origin commit data
------------------
Branch: ni/coolstream
Commit: 3ba1d4704a
Author: TangoCash <eric@loxat.de>
Date: 2021-09-09 (Thu, 09 Sep 2021)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -242,6 +242,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
||||
{"xmltv.data", &CControlAPI::xmltvepgCGI, "+xml"},
|
||||
{"xmltv.xml", &CControlAPI::xmltvepgCGI, "+xml"},
|
||||
{"xmltv.m3u", &CControlAPI::xmltvm3uCGI, ""},
|
||||
{"xmltvlist", &CControlAPI::xmltvlistCGI, "text/plain"},
|
||||
// utils
|
||||
{"build_live_url", &CControlAPI::build_live_url, ""},
|
||||
{"get_logo", &CControlAPI::logoCGI, "text/plain"},
|
||||
@@ -3415,6 +3416,70 @@ void CControlAPI::xmltvm3uCGI(CyhookHandler *hh)
|
||||
|
||||
hh->SendResult(result);
|
||||
}
|
||||
|
||||
void CControlAPI::xmltvlistCGI(CyhookHandler *hh)
|
||||
{
|
||||
std::vector<std::string>::iterator it;
|
||||
std::vector<std::string> url_list;
|
||||
std::string tmp;
|
||||
std::string::size_type i = 0;
|
||||
|
||||
if (!hh->ParamList["webtv"].empty())
|
||||
{
|
||||
std::string webtv_url = hh->ParamList["webtv"];
|
||||
g_settings.webtv_xml.clear();
|
||||
url_list = ::split(webtv_url, '\n');
|
||||
for (it = url_list.begin(); it != url_list.end(); it++)
|
||||
{
|
||||
tmp = (*it);
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\n'), tmp.end());
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\r'), tmp.end());
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\t'), tmp.end());
|
||||
if (!tmp.empty())
|
||||
g_settings.webtv_xml.push_back(tmp);
|
||||
}
|
||||
}
|
||||
else
|
||||
g_settings.webtv_xml.clear();
|
||||
|
||||
if (!hh->ParamList["webradio"].empty())
|
||||
{
|
||||
std::string webradio_url = hh->ParamList["webradio"];
|
||||
g_settings.webradio_xml.clear();
|
||||
url_list = ::split(webradio_url, '\n');
|
||||
for (it = url_list.begin(); it != url_list.end(); it++)
|
||||
{
|
||||
tmp = (*it);
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\n'), tmp.end());
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\r'), tmp.end());
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\t'), tmp.end());
|
||||
if (!tmp.empty())
|
||||
g_settings.webradio_xml.push_back(tmp);
|
||||
}
|
||||
}
|
||||
else
|
||||
g_settings.webradio_xml.clear();
|
||||
|
||||
if (!hh->ParamList["xmltv"].empty())
|
||||
{
|
||||
std::string xmltv_url = hh->ParamList["xmltv"];
|
||||
g_settings.xmltv_xml.clear();
|
||||
url_list = ::split(xmltv_url, '\n');
|
||||
for (it = url_list.begin(); it != url_list.end(); it++)
|
||||
{
|
||||
tmp = (*it);
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\n'), tmp.end());
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\r'), tmp.end());
|
||||
tmp.erase(std::remove(tmp.begin(), tmp.end(), '\t'), tmp.end());
|
||||
if (!tmp.empty())
|
||||
g_settings.xmltv_xml.push_back(tmp);
|
||||
}
|
||||
}
|
||||
else
|
||||
g_settings.xmltv_xml.clear();
|
||||
|
||||
hh->SendOk();
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
// audio_no : (optional) audio channel
|
||||
// host : (optional) ip of dbox
|
||||
|
Reference in New Issue
Block a user