From 77116aa07b0f646adfb12c386044b1c6879624e8 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 18 May 2015 16:06:47 +0300 Subject: [PATCH] zapit/src/bouquets.cpp: fix webtv loading before ubouquets, do not save webtv 'bouquets' to bouquets.xml --- src/zapit/include/zapit/bouquets.h | 13 ++++++++++++- src/zapit/src/bouquets.cpp | 6 ++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/zapit/include/zapit/bouquets.h b/src/zapit/include/zapit/bouquets.h index bca049475..0c169c289 100644 --- a/src/zapit/include/zapit/bouquets.h +++ b/src/zapit/include/zapit/bouquets.h @@ -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); diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 0f5e68a31..dba58fd0f 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -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);