Merge pull request #4598 from jmarshallnz/plugins_run_as_plugins
authorjmarshallnz <jcmarsha@gmail.com>
Fri, 25 Apr 2014 09:47:20 +0000 (21:47 +1200)
committerJonathan Marshall <jmarshall@xbmc.org>
Fri, 25 Apr 2014 21:05:24 +0000 (09:05 +1200)
[plugins] ensure we lookup the add-on as a plugin before trying any other extension point

xbmc/filesystem/PluginDirectory.cpp

index 50dd45a..bf9ca34 100644 (file)
@@ -90,7 +90,9 @@ bool CPluginDirectory::StartScript(const CStdString& strPath, bool retrievingDir
 {
   CURL url(strPath);
 
-  if (!CAddonMgr::Get().GetAddon(url.GetHostName(), m_addon, ADDON_UNKNOWN) && 
+  // try the plugin type first, and if not found, try an unknown type
+  if (!CAddonMgr::Get().GetAddon(url.GetHostName(), m_addon, ADDON_PLUGIN) &&
+      !CAddonMgr::Get().GetAddon(url.GetHostName(), m_addon, ADDON_UNKNOWN) &&
       !CAddonInstaller::Get().PromptForInstall(url.GetHostName(), m_addon))
   {
     CLog::Log(LOGERROR, "Unable to find plugin %s", url.GetHostName().c_str());