From e5a76941fedd79130a2e1398176b9ef9dfb6bcc1 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Fri, 31 Aug 2018 20:51:51 +0200 Subject: [PATCH] add settings for xmltv epg todo: GUI for testing edit your neutrino.conf: webtv_xml_0=http:///control/xmltv.m3u webtv_xml_count=1 webepg_0=http:///control/xmltv.xml webepg_count=1 Signed-off-by: Thilo Graf --- src/neutrino.cpp | 22 ++++++++++++++++++++++ src/system/settings.h | 1 + 2 files changed, 23 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6a0acb272..bb00e8675 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -714,6 +714,17 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.webtv_xml.push_back(webtv_xml); } + g_settings.web_epg.clear(); + int webepg_count = configfile.getInt32("webepg_count", 0); + if (webepg_count) { + for (int i = 0; i < webepg_count; i++) { + std::string k = "webepg_" + to_string(i); + std::string web_epg = configfile.getString(k, ""); + if (web_epg.empty()) + continue; + g_settings.web_epg.push_back(web_epg); + } + } g_settings.webradio_xml.clear(); #ifndef BOXMODEL_CS_HD1 @@ -1414,6 +1425,14 @@ void CNeutrinoApp::saveSetup(const char * fname) } configfile.setInt32 ( "webtv_xml_count", g_settings.webtv_xml.size()); + int webepg_count = 0; + for (std::list::iterator it = g_settings.web_epg.begin(); it != g_settings.web_epg.end(); ++it) { + std::string k = "webepg_" + to_string(webepg_count); + configfile.setString(k, *it); + webepg_count++; + } + configfile.setInt32 ( "webepg_count", g_settings.web_epg.size()); + saveKeys(); configfile.setInt32( "timeshift_pause", g_settings.timeshift_pause ); @@ -2564,6 +2583,9 @@ TIMER_STOP("################################## after all ####################### delete hintBox; } + for (std::list::iterator it = g_settings.web_epg.begin(); it != g_settings.web_epg.end(); ++it) + g_Sectionsd->readSIfromIPTVXML((*it).c_str()); + RealRun(); ExitRun(g_info.hw_caps->can_shutdown); diff --git a/src/system/settings.h b/src/system/settings.h index 6deeaeec1..955db1a0b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -324,6 +324,7 @@ struct SNeutrinoSettings std::list webtv_xml; std::list webradio_xml; + std::list web_epg; //personalize enum PERSONALIZE_SETTINGS //settings.h