Skip to content
Browse files

Fix for CNfoFile is looking only for same language scrapers as defaul…

…t scraper and only if "scrapers.langfallback" is true when processing url .nfo files

Seems that this logic was from old builds and wasn't updated.
  • Loading branch information...
1 parent 4e01356 commit fb5c8e23cf2fcc37e0777a3d7ec4d3884ab317b2 @Karlson2k committed with Jul 5, 2012
Showing with 17 additions and 25 deletions.
  1. +17 −23 xbmc/NfoFile.cpp
  2. +0 −2 xbmc/NfoFile.h
View
40 xbmc/NfoFile.cpp
@@ -93,18 +93,29 @@ CNfoFile::NFOResult CNfoFile::Create(const CStdString& strPath, const ScraperPtr
vector<ScraperPtr> vecScrapers;
- // add selected scraper
+ // add selected scraper - first proirity
if (m_info)
vecScrapers.push_back(m_info);
+ // Add all scrapers except selected and default
VECADDONS addons;
CAddonMgr::Get().GetAddons(m_type,addons);
- // first pass - add language based scrapers
- if (m_info && g_guiSettings.GetBool("scrapers.langfallback"))
- AddScrapers(addons,vecScrapers);
- // add default scraper
- if (defaultScraper && m_info && m_info->ID() != defaultScraper->ID())
+ for (unsigned i = 0; i < addons.size(); ++i)
+ {
+ ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(addons[i]);
+
+ // skip if scraper requires settings and there's nothing set yet
+ if (scraper->RequiresSettings() && !scraper->HasUserSettings())
+ continue;
+
+ if( (!m_info || m_info->ID() != scraper->ID()) && (!defaultScraper || defaultScraper->ID() != scraper->ID()) )
+ vecScrapers.push_back(scraper);
+ }
+
+ // add default scraper - not user selectable so it's last priority
+ if( defaultScraper && (!m_info || m_info->ID() != defaultScraper->ID()) &&
+ ( !defaultScraper->RequiresSettings() || defaultScraper->HasUserSettings() ) )
vecScrapers.push_back(defaultScraper);
// search ..
@@ -179,20 +190,3 @@ void CNfoFile::Close()
m_doc = NULL;
m_scurl.Clear();
}
-
-void CNfoFile::AddScrapers(VECADDONS& addons,
- vector<ScraperPtr>& vecScrapers)
-{
- for (unsigned i=0;i<addons.size();++i)
- {
- ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(addons[i]);
-
- // skip if scraper requires settings and there's nothing set yet
- if (scraper->RequiresSettings() && !scraper->HasUserSettings())
- continue;
-
- // add same language and multi-language
- if (scraper->Language() == m_info->Language() || scraper->Language().Equals("multi"))
- vecScrapers.push_back(scraper);
- }
-}
View
2 xbmc/NfoFile.h
@@ -81,8 +81,6 @@ class CNfoFile
int Load(const CStdString&);
int Scrape(ADDON::ScraperPtr& scraper);
- void AddScrapers(ADDON::VECADDONS& addons,
- std::vector<ADDON::ScraperPtr>& vecScrapers);
};
#endif // !defined(AFX_NfoFile_H__641CCF68_6D2A_426E_9204_C0E4BEF12D00__INCLUDED_)

0 comments on commit fb5c8e2

Please sign in to comment.
Something went wrong with that request. Please try again.