diff --git a/src/zapit/include/zapit/bouquets.h b/src/zapit/include/zapit/bouquets.h index 12f38d84d..004e2d2d9 100644 --- a/src/zapit/include/zapit/bouquets.h +++ b/src/zapit/include/zapit/bouquets.h @@ -110,6 +110,7 @@ class CBouquetManager void readEPGMapping(); t_channel_id reMapEpgID(t_channel_id channelid); std::string reMapEpgXML(t_channel_id channelid); + void convert_E2_EPGMapping(std::string mapfile_in, std::string mapfile_out = "/tmp/epgmap.xml"); //logo downloads static void* LogoThread(void* _logolist); pthread_t thrLogo; diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 71debc435..4b7f36d0d 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -1309,6 +1309,42 @@ void CBouquetManager::readEPGMapping() xmlFreeDoc(epgmap_parser); } +void CBouquetManager::convert_E2_EPGMapping(std::string mapfile_in, std::string mapfile_out) +{ + FILE * outfile = NULL; + xmlDocPtr epgmap_parser = parseXmlFile(mapfile_in.c_str()); + + if (epgmap_parser != NULL) + { + outfile = fopen(mapfile_out.c_str(), "w"); + xmlNodePtr epgmap = xmlDocGetRootElement(epgmap_parser); + if(epgmap) + epgmap = xmlChildrenNode(epgmap); + + fprintf(outfile, + "\n" + "\n"); + + while (epgmap) { + const char *e2_channelid = xmlGetData(epgmap); + const char *xmlepg = xmlGetAttribute(epgmap, "id"); + u_int sid = 0,tsid = 0,onid = 0,sat = 0; + sscanf(e2_channelid,"1:0:1:%X:%X:%X:%X0000:0:0:0:", &sid, &tsid, &onid, &sat); + t_channel_id short_channel_id = create_channel_id(sid,onid,tsid); + CZapitChannel * cc = CServiceManager::getInstance()->FindChannel48(short_channel_id); + if (cc) { + if(xmlepg){ + fprintf(outfile,"\t%s --%s\n",cc->getChannelID(), xmlepg, cc->getName().c_str()); + } + } + epgmap = xmlNextNode(epgmap); + } + fprintf(outfile, "\n"); + fclose(outfile); + } + xmlFreeDoc(epgmap_parser); +} + std::string CBouquetManager::ReadMarkerValue(std::string strLine, const char* strMarkerName) { if (strLine.find(strMarkerName) != std::string::npos)