mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
bouquets: allow multiple epgmap.xml
Origin commit data
------------------
Branch: ni/coolstream
Commit: ef45ef8c9c
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-09-11 (Sat, 11 Sep 2021)
Origin message was:
------------------
- bouquets: allow multiple epgmap.xml
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -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')
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
@@ -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<std::string> epgmap_dirs;
|
||||
epgmap_dirs.push_back(CONFIGDIR "/zapit");
|
||||
epgmap_dirs.push_back(WEBTVDIR);
|
||||
epgmap_dirs.push_back(WEBTVDIR_VAR);
|
||||
|
||||
std::list<std::string> epgmaps;
|
||||
for (std::list<std::string>::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<std::string>::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)
|
||||
|
Reference in New Issue
Block a user