diff --git a/src/gui/webchannels_setup.cpp b/src/gui/webchannels_setup.cpp index bba62236a..36d85081c 100644 --- a/src/gui/webchannels_setup.cpp +++ b/src/gui/webchannels_setup.cpp @@ -302,6 +302,10 @@ bool CWebChannelsSetup::changeNotify(const neutrino_locale_t OptionName, void */ int filefilter(const struct dirent *entry) { + std::string f = entry->d_name; + if (f.find("epgmap.xml") != std::string::npos) + return 0; + int len = strlen(entry->d_name); if (len > 3 && ( (entry->d_name[len - 3] == 'x' && entry->d_name[len - 2] == 'm' && entry->d_name[len - 1] == 'l') diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 4d18e12cf..fe61fa341 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -1366,8 +1367,33 @@ void CBouquetManager::readEPGMapping() if(!EpgXMLMapping.empty()) EpgXMLMapping.clear(); - const std::string epg_map_dir = CONFIGDIR "/zapit/epgmap.xml"; - xmlDocPtr epgmap_parser = parseXmlFile(epg_map_dir.c_str()); + std::list epgmap_dirs; + epgmap_dirs.push_back(CONFIGDIR "/zapit"); + epgmap_dirs.push_back(WEBTVDIR); + epgmap_dirs.push_back(WEBTVDIR_VAR); + + std::list epgmaps; + for (std::list::iterator it = epgmap_dirs.begin(); it != epgmap_dirs.end(); ++it) + { + DIR *dp; + struct dirent *d; + + if ((dp = opendir((*it).c_str())) == NULL) + continue; + + while ((d = readdir(dp)) != NULL) + { + std::string f = d->d_name; + if(f.find("epgmap.xml") != std::string::npos) + epgmaps.push_back((*it) + "/" + f); + } + } + + for (std::list::iterator it = epgmaps.begin(); it != epgmaps.end(); ++it) + { + INFO("read %s", (*it).c_str()); + + xmlDocPtr epgmap_parser = parseXmlFile((*it).c_str()); if (epgmap_parser != NULL) { @@ -1397,6 +1423,8 @@ void CBouquetManager::readEPGMapping() } } xmlFreeDoc(epgmap_parser); + + } // for loop } void CBouquetManager::convert_E2_EPGMapping(std::string mapfile_in, std::string mapfile_out)