zapit/src/bouquets.cpp: fix webtv loading before ubouquets,

do not save webtv 'bouquets' to bouquets.xml
This commit is contained in:
[CST] Focus
2015-05-18 16:06:47 +03:00
parent 4b999db6c8
commit 77116aa07b
2 changed files with 16 additions and 3 deletions

View File

@@ -44,12 +44,23 @@ class CZapitBouquet
bool bFav;
bool bOther;
int bScanEpg;
bool bVirtual; // dont save
t_satellite_position satellitePosition;
ZapitChannelList radioChannels;
ZapitChannelList tvChannels;
inline CZapitBouquet(const std::string name) { Name = name; BqID=DEFAULT_BQ_ID; bHidden = DEFAULT_BQ_HIDDEN; bLocked = DEFAULT_BQ_LOCKED; bUser = false; bOther = DEFAULT_BQ_OTHER; bScanEpg = DEFAULT_BQ_SCANEPG; }
inline CZapitBouquet(const std::string name)
{
Name = name;
BqID=DEFAULT_BQ_ID;
bHidden = DEFAULT_BQ_HIDDEN;
bLocked = DEFAULT_BQ_LOCKED;
bUser = false;
bOther = DEFAULT_BQ_OTHER;
bScanEpg = DEFAULT_BQ_SCANEPG;
bVirtual = false;
}
void addService(CZapitChannel* newChannel);

View File

@@ -272,7 +272,7 @@ void CBouquetManager::saveBouquets(void)
for (unsigned int i = 0; i < Bouquets.size(); i++) {
if (Bouquets[i] != remainChannels) {
DBG("save Bouquets: name %s user: %d\n", Bouquets[i]->Name.c_str(), Bouquets[i]->bUser);
if(!Bouquets[i]->bUser) {
if(!Bouquets[i]->bUser && !Bouquets[i]->bVirtual) {
writeBouquet(bouq_fd, i,false);
}
}
@@ -492,8 +492,8 @@ void CBouquetManager::loadBouquets(bool ignoreBouquetFile)
sortBouquets();
}
parseBouquetsXml(UBOUQUETS_XML, true);
loadWebtv();
parseBouquetsXml(UBOUQUETS_XML, true);
renumServices();
TIMER_STOP("[zapit] bouquet loading took");
}
@@ -813,6 +813,7 @@ void CBouquetManager::loadWebtv()
if (!prov)
prov = "WebTV";
pbouquet = addBouquetIfNotExist(prov);
pbouquet->bVirtual = true;
while ((xmlGetNextOccurence(l1, "webtv"))) {
const char *title = xmlGetAttribute(l1, "title");
@@ -824,6 +825,7 @@ void CBouquetManager::loadWebtv()
if (genre) {
std::string bname = prov ? std::string(std::string(prov) + " ") + genre : genre;
gbouquet = addBouquetIfNotExist(bname);
gbouquet->bVirtual = true;
}
if (title && url) {
t_channel_id chid = create_channel_id64(0, 0, 0, 0, 0, url);