Skip to content
Browse files

Merge pull request #1121 from Karlson2k/Fix-NfoUrl

[NfoFile] Fix for nfofile with URL
  • Loading branch information...
2 parents aca862c + 13a34b0 commit eb76c0908e91b55f2d715efb08b1376fd5007d4d @jmarshallnz jmarshallnz committed
Showing with 18 additions and 29 deletions.
  1. +1 −3 language/English/strings.po
  2. +17 −23 xbmc/NfoFile.cpp
  3. +0 −2 xbmc/NfoFile.h
  4. +0 −1 xbmc/settings/GUISettings.cpp
View
4 language/English/strings.po
@@ -7721,9 +7721,7 @@ msgctxt "#21415"
msgid "Default music video scraper"
msgstr ""
-msgctxt "#21416"
-msgid "Enable fallback based on scraper language"
-msgstr ""
+#empty string id 21416
msgctxt "#21417"
msgid "- Settings"
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)
@arnova Team Kodi member
arnova added a note

Little typo ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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_)
View
1 xbmc/settings/GUISettings.cpp
@@ -778,7 +778,6 @@ void CGUISettings::Initialize()
AddDefaultAddon(NULL, "scrapers.moviesdefault", 21413, "metadata.themoviedb.org", ADDON_SCRAPER_MOVIES);
AddDefaultAddon(NULL, "scrapers.tvshowsdefault", 21414, "metadata.tvdb.com", ADDON_SCRAPER_TVSHOWS);
AddDefaultAddon(NULL, "scrapers.musicvideosdefault", 21415, "metadata.musicvideos.last.fm", ADDON_SCRAPER_MUSICVIDEOS);
- AddBool(NULL, "scrapers.langfallback", 21416, false);
// service settings
AddGroup(6, 14036);

0 comments on commit eb76c09

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