- bouquets: allow epgmapping directly from webtv xml file

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-09-12 21:23:40 +02:00
committed by Thilo Graf
parent 92a1028aba
commit ced577eb7a

View File

@@ -542,10 +542,10 @@ void CBouquetManager::loadBouquets(bool ignoreBouquetFile)
renumServices(); renumServices();
CServiceManager::getInstance()->SetCIFilter(); CServiceManager::getInstance()->SetCIFilter();
if(!EpgIDMapping.empty()){ if(!EpgIDMapping.empty()){
EpgIDMapping.clear(); EpgIDMapping.clear();
} }
if(!EpgXMLMapping.empty()){ if(!EpgXMLMapping.empty()){
EpgXMLMapping.clear(); EpgXMLMapping.clear();
} }
TIMER_STOP("[zapit] bouquet loading took"); TIMER_STOP("[zapit] bouquet loading took");
} }
@@ -933,6 +933,7 @@ void CBouquetManager::loadWebchannels(int mode)
const char *desc = xmlGetAttribute(l1, "description"); const char *desc = xmlGetAttribute(l1, "description");
const char *genre = xmlGetAttribute(l1, "genre"); const char *genre = xmlGetAttribute(l1, "genre");
const char *epgid = xmlGetAttribute(l1, "epgid"); const char *epgid = xmlGetAttribute(l1, "epgid");
const char *epgmap = xmlGetAttribute(l1, "epgmap");
const char *script = xmlGetAttribute(l1, "script"); const char *script = xmlGetAttribute(l1, "script");
t_channel_id epg_id = 0; t_channel_id epg_id = 0;
if (epgid) if (epgid)
@@ -947,7 +948,7 @@ void CBouquetManager::loadWebchannels(int mode)
} }
} }
else else
epg_id = strtoull(epgid, NULL, 16); epg_id = strtoull(epgid, NULL, 16);
} }
CZapitBouquet* gbouquet = pbouquet; CZapitBouquet* gbouquet = pbouquet;
@@ -970,12 +971,20 @@ void CBouquetManager::loadWebchannels(int mode)
t_channel_id new_epgid = reMapEpgID(chid); t_channel_id new_epgid = reMapEpgID(chid);
if(new_epgid) if(new_epgid)
channel->setEPGid(new_epgid); channel->setEPGid(new_epgid);
std::string new_epgxml = reMapEpgXML(chid); char buf[100];
if(!new_epgxml.empty()) { snprintf(buf, sizeof(buf), "%llx", chid & 0xFFFFFFFFFFFFULL);
char buf[100]; if (epgmap)
snprintf(buf, sizeof(buf), "%llx", chid & 0xFFFFFFFFFFFFULL); {
std::string new_epgxml(epgmap);
channel->setEPGmap("#" + new_epgxml + "=" + buf); channel->setEPGmap("#" + new_epgxml + "=" + buf);
} }
else
{
std::string new_epgxml = reMapEpgXML(chid);
if(!new_epgxml.empty()) {
channel->setEPGmap("#" + new_epgxml + "=" + buf);
}
}
channel->flags = CZapitChannel::UPDATED; channel->flags = CZapitChannel::UPDATED;
if (gbouquet) if (gbouquet)
gbouquet->addService(channel); gbouquet->addService(channel);