From adf7457279ddc8e12f74c7d43e2a355960f399c3 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 19 Aug 2018 21:14:54 +0200 Subject: [PATCH] supplemental to a7be95b6ada4c7aaaafc39596ab0c36a7a42cf9e Signed-off-by: Thilo Graf --- src/zapit/src/bouquets.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 77004a92c..f1427c404 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -934,6 +934,7 @@ void CBouquetManager::loadWebchannels(int mode) std::string desc; std::string title = ""; std::string group = ""; + std::string epgid = ""; CZapitBouquet* pbouquet = NULL; infile.open((*it).c_str(), std::ifstream::in); @@ -967,7 +968,7 @@ void CBouquetManager::loadWebchannels(int mode) std::string strInfoLine = strLine.substr(++iColon, --iComma - iColon); desc = ReadMarkerValue(strInfoLine, TVG_INFO_NAME_MARKER); group = ReadMarkerValue(strInfoLine, GROUP_NAME_MARKER); - INFO("Title %s / %s ...", title.c_str(), group.c_str()); + epgid = ReadMarkerValue(strInfoLine, TVG_INFO_ID_MARKER); } pbouquet = addBouquetIfNotExist((mode == MODE_WEBTV) ? "WebTV" : "WebRadio"); @@ -999,7 +1000,14 @@ void CBouquetManager::loadWebchannels(int mode) } t_channel_id chid = create_channel_id64(0, 0, 0, 0, 0, url); - CZapitChannel * channel = new CZapitChannel(title.c_str(), chid, url, desc.c_str(), epg_id, NULL, mode); + std::string epg_script = ""; + if (!epgid.empty()) { + char buf[100]; + snprintf(buf, sizeof(buf), "%llx", chid & 0xFFFFFFFFFFFFULL); + // keep the tvg-id for later epg injection + epg_script = "#" + epgid + "=" + buf; + } + CZapitChannel * channel = new CZapitChannel(title.c_str(), chid, url, desc.c_str(), epg_id, epg_script.c_str(), mode); CServiceManager::getInstance()->AddChannel(channel); channel->flags = CZapitChannel::UPDATED; if (gbouquet) @@ -1057,8 +1065,8 @@ void CBouquetManager::loadWebchannels(int mode) else pbouquet->bWebradio = true; - t_channel_id chid = create_channel_id64(0, 0, 0, 0, 0, url.c_str()); - CZapitChannel * channel = new CZapitChannel(title.c_str(), chid, url.c_str(), desc.c_str(), epg_id, NULL, mode); + t_channel_id chid = create_channel_id64(0, 0, 0, 0, 0, ::decodeUrl(url).c_str()); + CZapitChannel * channel = new CZapitChannel(title.c_str(), chid, ::decodeUrl(url).c_str(), desc.c_str(), epg_id, NULL, mode); CServiceManager::getInstance()->AddChannel(channel); channel->flags = CZapitChannel::UPDATED; if (pbouquet)