diff options
author | spiff_ <spiff_@svn> | 2010-05-23 22:30:08 +0000 |
---|---|---|
committer | spiff_ <spiff_@svn> | 2010-05-23 22:30:08 +0000 |
commit | a16721efae1433347b15e350e42f4be8ece1546f (patch) | |
tree | 76f49addf4bf26b403daa25e6d284fbbea3c7952 | |
parent | f0b69e17e392e4ca16c133171d661ea14920898d (diff) |
changed: move scraper libraries to cpluff
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30469 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
20 files changed, 201 insertions, 179 deletions
diff --git a/addons/metadata.allmusic.com/description.xml b/addons/metadata.allmusic.com/addon.xml index dbdbba2a8e..667cf2a273 100644 --- a/addons/metadata.allmusic.com/description.xml +++ b/addons/metadata.allmusic.com/addon.xml @@ -1,34 +1,31 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addoninfo> - <id>metadata.allmusic.com</id> - <type>scraper</type> - <title>AllMusic</title> - <library>allmusic.xml</library> - <version>1.0.0</version> - <platforms> +<addon id="metadata.allmusic.com" + name="AllMusic" + version="1.0.0" + provider-name="Team XBMC"> + <requires> + <import addon="xbmc.metadata" version="1.0"/> + <import addon="metadata.common.last.fm" version="1.0"/> + <import addon="metadata.common.allmusic.com" version="1.0"/> + <import addon="metadata.common.htbackdrops.com" version="1.0"/> + </requires> + <extension point="xbmc.metadata.scraper" + library="allmusic.xml"/> + <extension point="xbmc.addon.metadata"> <platform>all</platform> - </platforms> - <minversion> - <xbmc>20000</xbmc> - </minversion> - <summary>AllMusic Scraper</summary> - <description>Use AllMusic.com to fill your libray metadata information. + <minversion>20000</minversion> + <summary>AllMusic Scraper</summary> + <description>Use AllMusic.com to fill your libray metadata information. The allmusic website was created in 1995 as a place for music fans to indulge their passion. The AMG editorial staff, along with hundreds of expert contributors (all music fanatics in their own right), has made allmusic the most comprehensive music reference source on the planet. They are all dedicated to creating and maintaining the knowledgeable, spirited content that music lovers and industry professionals have come to expect from AMG. All genres and styles of music are covered here, ranging from the most commercially popular to the most obscure. We critique albums and artists within the context of their own genres - from opera to garage rock to traditional country. This ensures that fans of any style of music can depend on us to keep them up-to-date with their favorite artists as well as introduce them to new sounds.</description> - <description lang="nl">Gebruik AllMusic.com om de metadata van jouw collectie op te halen. + <description lang="nl">Gebruik AllMusic.com om de metadata van jouw collectie op te halen. De AllMusic website is ontstaan in 1995 als webstek voor echte muziekfans. The AMG redactie, samen met honderden bijdragende experen (allen muziekfans in hun eigen gebied), hebben van allmusic het meest complete muziek naslagwerk gemaakt op deze planeet. Alle genres en stijlen worden gedekt, gaande van de meest commerciele tot de meest alternatieve. We bekritiseren albums en artiesten in hun eigen genre, van opera tot garagerock tot traditionele country. Dit maakt dat fans van elke muziekstijl bij ons terecht kunnen voor de laatste informatie rond hun favoriete artiesten of om nieuwe muziek te leren ontdekken.</description> - <author>Team XBMC</author> - <dependencies> - <dependency minversion="1.0.0" maxversion="">metadata.common.last.fm</dependency> - <dependency minversion="1.0.0" maxversion="">metadata.common.allmusic.com</dependency> - <dependency minversion="1.0.0" maxversion="">metadata.common.discogs.com</dependency> - <dependency minversion="1.0.0" maxversion="">metadata.common.htbackdrops.com</dependency> - </dependencies> - <supportedcontent> - <content>albums</content> - <content>artists</content> - </supportedcontent> -</addoninfo> + <supportedcontent> + <content>albums</content> + <content>artists</content> + </supportedcontent> + </extension> +</addon> diff --git a/addons/metadata.common.allmusic.com/addon.xml b/addons/metadata.common.allmusic.com/addon.xml new file mode 100644 index 0000000000..db0bcd7985 --- /dev/null +++ b/addons/metadata.common.allmusic.com/addon.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<addon id="metadata.common.allmusic.com" + name="AllMusic" + version="1.0.0" + provider-name="Team XBMC"> + <requires> + <import addon="xbmc.metadata" version="1.0"/> + </requires> + <extension point="xbmc.metadata.scraper.library" + library="allmusic.xml"/> + <extension point="xbmc.addon.metadata"> + <platform>all</platform> + <minversion>20000</minversion> + <summary>AllMusic Music Scraper</summary> + <summary lang="nl">AllMusic Muziek Scraper</summary> + <description>Download Music information from www.allmusic.com</description> + <description lang="nl">Download muziek informatie van www.allmusic.com</description> + </extension> +</addon> diff --git a/addons/metadata.common.allmusic.com/description.xml b/addons/metadata.common.allmusic.com/description.xml deleted file mode 100644 index 0665e1260b..0000000000 --- a/addons/metadata.common.allmusic.com/description.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addoninfo> - <id>metadata.common.allmusic.com</id> - <type>scraper-library</type> - <title>AllMusic</title> - <library>allmusic.xml</library> - <version>1.0.0</version> - <platforms> - <platform>all</platform> - </platforms> - <minversion> - <xbmc>20000</xbmc> - </minversion> - <summary>AllMusic Music Scraper</summary> - <summary lang="nl">AllMusic Muziek Scraper</summary> - <description>Download Music information from www.allmusic.com</description> - <description lang="nl">Download muziek informatie van www.allmusic.com</description> - <author>TEAMXBMC</author> - <supportedcontent> - <content>albums</content> - <content>artists</content> - </supportedcontent> -</addoninfo> diff --git a/addons/metadata.common.dtrailer.com/addon.xml b/addons/metadata.common.dtrailer.com/addon.xml new file mode 100644 index 0000000000..c501eb293f --- /dev/null +++ b/addons/metadata.common.dtrailer.com/addon.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<addon id="metadata.common.dtrailer.com" + name="DTrailer common scraper functions" + version="1.0.0" + provider-name="Team XBMC"> + <requires> + <import addon="xbmc.metadata" version="1.0"/> + </requires> + <extension point="xbmc.metadata.scraper.library" + library="dtrailer.xml"/> + <extension point="xbmc.addon.metadata"> + <platform>all</platform> + <minversion>20000</minversion> + <summary>DTrailer Scraper Library</summary> + <summary lang="nl">DTralier Scraper Collectie</summary> + <description>Download trailers from www.themoviedb.org</description> + <description lang="nl">Download trailers van www.themoviedb.org</description> + </extension> +</addon> diff --git a/addons/metadata.common.dtrailer.com/description.xml b/addons/metadata.common.dtrailer.com/description.xml deleted file mode 100644 index 45184412c7..0000000000 --- a/addons/metadata.common.dtrailer.com/description.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addoninfo> - <id>metadata.common.dtrailer.com</id> - <type>scraper-library</type> - <title>DTrailer</title> - <library>dtrailer.xml</library> - <version>1.0.0</version> - <platforms> - <platform>all</platform> - </platforms> - <minversion> - <xbmc>20000</xbmc> - </minversion> - <summary>DTrailer Scraper Library</summary> - <description>some description</description> - <author>TEAMXBMC</author> - <supportedcontent> - <content>movies</content> - </supportedcontent> -</addoninfo> diff --git a/addons/metadata.common.htbackdrops.com/addon.xml b/addons/metadata.common.htbackdrops.com/addon.xml new file mode 100644 index 0000000000..27b285b173 --- /dev/null +++ b/addons/metadata.common.htbackdrops.com/addon.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<addon id="metadata.common.htbackdrops.com" + name="HTBackdrops" + version="1.0.0" + provider-name="Team XBMC"> + <requires> + <import addon="xbmc.metadata" version="1.0"/> + </requires> + <extension point="xbmc.metadata.scraper.library" + library="htbackdrops.xml"/> + <extension point="xbmc.addon.metadata"> + <platform>all</platform> + <minversion>20000</minversion> + <summary>HTBackdrops Scraper Library</summary> + <description>some description</description> + </extension> +</addon> diff --git a/addons/metadata.common.htbackdrops.com/description.xml b/addons/metadata.common.htbackdrops.com/description.xml deleted file mode 100644 index 0b823286d7..0000000000 --- a/addons/metadata.common.htbackdrops.com/description.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addoninfo> - <id>metadata.common.htbackdrops.com</id> - <type>scraper-library</type> - <title>HTBackdrops</title> - <library>htbackdrops.xml</library> - <version>1.0.0</version> - <platforms> - <platform>all</platform> - </platforms> - <minversion> - <xbmc>20000</xbmc> - </minversion> - <summary>HTBackdrops Scraper Library</summary> - <description>some description</description> - <author>TEAMXBMC</author> - <supportedcontent> - <content>movies</content> - </supportedcontent> -</addoninfo> diff --git a/addons/metadata.common.last.fm/addon.xml b/addons/metadata.common.last.fm/addon.xml new file mode 100644 index 0000000000..5f198dd442 --- /dev/null +++ b/addons/metadata.common.last.fm/addon.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<addon id="metadata.common.last.fm" + name="Last.FM" + version="1.0.0" + provider-name="Team XBMC"> + <requires> + <import addon="xbmc.metadata" version="1.0"/> + </requires> + <extension point="xbmc.metadata.scraper.library" + library="lastfm.xml"/> + <extension point="xbmc.addon.metadata"> + <platform>all</platform> + <minversion>20000</minversion> + <summary>LastFM Scraper Library</summary> + <summary lang="nl">LastFM Scraper Collectie</summary> + <description>Download Music information</description> + <description lang="nl">Download muziek informatie</description> + </extension> +</addon> diff --git a/addons/metadata.common.last.fm/description.xml b/addons/metadata.common.last.fm/description.xml deleted file mode 100644 index 48b117abbe..0000000000 --- a/addons/metadata.common.last.fm/description.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addoninfo> - <id>metadata.common.last.fm</id> - <type>scraper-library</type> - <title>LastFM</title> - <library>lastfm.xml</library> - <version>1.0.0</version> - <platforms> - <platform>all</platform> - </platforms> - <minversion> - <xbmc>20000</xbmc> - </minversion> - <summary>LastFM Scraper Library</summary> - <summary lang="nl">LastFM Scraper Collectie</summary> - <description>Download Music information</description> - <description lang="nl">Download muziek informatie</description> - <author>TEAMXBMC</author> - <supportedcontent> - <content>albums</content> - <content>artists</content> - </supportedcontent> -</addoninfo> diff --git a/addons/metadata.common.themoviedb.org/addon.xml b/addons/metadata.common.themoviedb.org/addon.xml new file mode 100644 index 0000000000..a5c59e0d44 --- /dev/null +++ b/addons/metadata.common.themoviedb.org/addon.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<addon id="metadata.common.themoviedb.org" + name="The MovieDB common scraper functions" + version="1.0.0" + provider-name="Team XBMC"> + <requires> + <import addon="xbmc.metadata" version="1.0"/> + </requires> + <extension point="xbmc.metadata.scraper.library" + library="tmdb.xml"/> + <extension point="xbmc.addon.metadata"> + <platform>all</platform> + <minversion>20000</minversion> + <summary>TMDb Scraper Library</summary> + <summary lang="nl">TMDb Scraper Collectie</summary> + <description>Download thumbs and fanarts from www.themoviedb.org</description> + <description lang="nl">Download afbeeldingen en fanart van www.themoviedb.org</description> + </extension> +</addon> diff --git a/addons/metadata.common.themoviedb.org/description.xml b/addons/metadata.common.themoviedb.org/description.xml deleted file mode 100644 index 012a5624a7..0000000000 --- a/addons/metadata.common.themoviedb.org/description.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addoninfo> - <id>metadata.common.themoviedb.org</id> - <type>scraper-library</type> - <title>TMDb</title> - <library>tmdb.xml</library> - <version>1.0.0</version> - <platforms> - <platform>all</platform> - </platforms> - <minversion> - <xbmc>20000</xbmc> - </minversion> - <summary>TMDb Scraper Library</summary> - <summary lang="nl">TMDb Scraper Collectie</summary> - <description>Download thumbs and fanarts from www.themoviedb.org</description> - <description lang="nl">Download afbeeldingen en fanart van www.themoviedb.org</description> - <author>TEAMXBMC</author> - <supportedcontent> - <content>movies</content> - </supportedcontent> -</addoninfo> diff --git a/addons/metadata.themoviedb.org/addon.xml b/addons/metadata.themoviedb.org/addon.xml new file mode 100644 index 0000000000..3a968de544 --- /dev/null +++ b/addons/metadata.themoviedb.org/addon.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<addon id="metadata.themoviedb.org" + name="The MovieDB" + version="1.0.0" + provider-name="Team XBMC"> + <requires> + <import addon="xbmc.metadata" version="1.0"/> + <import addon="metadata.common.themoviedb.org" version="1.0"/> + <import addon="metadata.common.dtrailer.com" version="1.0"/> + </requires> + <extension point="xbmc.metadata.scraper" + library="tmdb.xml"/> + <extension point="xbmc.addon.metadata"> + <platform>all</platform> + <minversion>20000</minversion> + <summary>TMDB Movie Scraper</summary> + <summary lang="nl">TMDB Film Scraper</summary> + <description>themoviedb.org is a free and open movie database. It's completely user driven by people like you. TMDb is currently used by millions of people every month and with their and powerful API, it is also used by many popular media centers like XBMC to retrieve Movie Metadata, Posters and Fanart to enrich the users experience</description> + <description lang="nl">themoviedb.org is een vrije en open film databank. Het wordt compleet aangedreven door gebruikers zoals jezelf. TMDb wordt momenteel maandelijks gebruikt door miljoenen mensen. Hun krachtige API maakt het voor mediaspelers zoals XBMC mogelijk om voor een film bijkomende informatie, posters en fanarts op te halen.</description> + <supportedcontent> + <content>movies</content> + </supportedcontent> + </extension> +</addon> diff --git a/addons/metadata.themoviedb.org/description.xml b/addons/metadata.themoviedb.org/description.xml deleted file mode 100644 index eac4b4d307..0000000000 --- a/addons/metadata.themoviedb.org/description.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addoninfo> - <id>metadata.themoviedb.org</id> - <type>scraper</type> - <title>TMDB</title> - <library>tmdb.xml</library> - <version>1.0.0</version> - <platforms> - <platform>all</platform> - </platforms> - <minversion> - <xbmc>20000</xbmc> - </minversion> - <summary>TMDB Movie Scraper</summary> - <summary lang="nl">TMDB Film Scraper</summary> - <description>themoviedb.org is a free and open movie database. It's completely user driven by people like you. TMDb is currently used by millions of people every month and with their and powerful API, it is also used by many popular media centers like XBMC to retrieve Movie Metadata, Posters and Fanart to enrich the users experience</description> - <description lang="nl">themoviedb.org is een vrije en open film databank. Het wordt compleet aangedreven door gebruikers zoals jezelf. TMDb wordt momenteel maandelijks gebruikt door miljoenen mensen. Hun krachtige API maakt het voor mediaspelers zoals XBMC mogelijk om voor een film bijkomende informatie, posters en fanarts op te halen.</description> - <author>Team XBMC</author> - <dependencies> - <dependency minversion="1.0.0" maxversion="">metadata.common.themoviedb.org</dependency> - <dependency minversion="1.0.0" maxversion="">metadata.common.dtrailer.com</dependency> - </dependencies> - <supportedcontent> - <content>movies</content> - </supportedcontent> -</addoninfo> diff --git a/addons/xbmc.metadata/addon.xml b/addons/xbmc.metadata/addon.xml index a9ea02511e..8e252039cd 100644 --- a/addons/xbmc.metadata/addon.xml +++ b/addons/xbmc.metadata/addon.xml @@ -4,4 +4,5 @@ <import addon="xbmc.core" version="0.1"/> </requires> <extension-point id="scraper" schema="scraper.xsd"/> + <extension-point id="scraper.library" schema="scraper.xsd"/> </addon> diff --git a/xbmc/addons/Addon.cpp b/xbmc/addons/Addon.cpp index b851daf57f..c57145511f 100644 --- a/xbmc/addons/Addon.cpp +++ b/xbmc/addons/Addon.cpp @@ -30,10 +30,12 @@ #include "../osx/OSXGNUReplacements.h" #endif #include "log.h" +#include <vector> #include <string.h> using XFILE::CDirectory; using XFILE::CFile; +using namespace std; namespace ADDON { @@ -107,7 +109,7 @@ const CStdString TranslateType(const ADDON::TYPE &type, bool pretty/*=false*/) } case ADDON::ADDON_SCRAPER_LIBRARY: { - return "scraper-library"; + return "xbmc.metadata.scraper.library"; } case ADDON::ADDON_SCREENSAVER: { @@ -164,7 +166,7 @@ const ADDON::TYPE TranslateType(const CStdString &string) { if (string.Equals("pvrclient")) return ADDON_PVRDLL; else if (string.Equals("xbmc.metadata.scraper")) return ADDON_SCRAPER; - else if (string.Equals("scraper-library")) return ADDON_SCRAPER_LIBRARY; + else if (string.Equals("xbmc.metadata.scraper.library")) return ADDON_SCRAPER_LIBRARY; else if (string.Equals("xbmc.ui.screensaver")) return ADDON_SCREENSAVER; else if (string.Equals("xbmc.player.musicviz")) return ADDON_VIZ; else if (string.Equals("visualization-library")) return ADDON_VIZ_LIBRARY; @@ -237,8 +239,9 @@ AddonProps::AddonProps(cp_plugin_info_t *props) description = CAddonMgr::Get().GetTranslatedString(metadata->configuration, "description"); disclaimer = CAddonMgr::Get().GetTranslatedString(metadata->configuration, "disclaimer"); license = CAddonMgr::Get().GetExtValue(metadata->configuration, "license"); - // FIXME this needs to grab all siblings... - contents.insert(TranslateContent(CAddonMgr::Get().GetExtValue(metadata->configuration, "content"))); + vector<CStdString> content = CAddonMgr::Get().GetExtValues(metadata->configuration,"supportedcontent"); + for (unsigned int i=0;i<content.size();++i) + contents.insert(TranslateContent(content[i])); //FIXME other stuff goes here //CStdString version = CAddonMgr::Get().GetExtValue(metadata->configuration, "minversion/xbmc"); } @@ -343,6 +346,7 @@ void CAddon::BuildLibName(cp_plugin_info_t *props) case ADDON_SCREENSAVER: case ADDON_SCRIPT: case ADDON_SCRAPER: + case ADDON_SCRAPER_LIBRARY: { CStdString temp = CAddonMgr::Get().GetExtValue(props->extensions->configuration, "@library"); m_strLibName = temp; @@ -559,12 +563,12 @@ void CAddon::UpdateSetting(const CStdString& key, const CStdString& value, const // Setting not found, add it TiXmlElement nodeSetting("setting"); - nodeSetting.SetAttribute("id", std::string(key.c_str())); //FIXME otherwise attribute value isn't updated + nodeSetting.SetAttribute("id", string(key.c_str())); //FIXME otherwise attribute value isn't updated if (!type.empty()) - nodeSetting.SetAttribute("type", std::string(type.c_str())); + nodeSetting.SetAttribute("type", string(type.c_str())); else nodeSetting.SetAttribute("type", "text"); - nodeSetting.SetAttribute("value", std::string(value.c_str())); + nodeSetting.SetAttribute("value", string(value.c_str())); m_userXmlDoc.RootElement()->InsertEndChild(nodeSetting); } @@ -585,6 +589,11 @@ const CStdString CAddon::Icon() const return CUtil::AddFileToFolder(m_props.path, m_props.icon); } +ADDONDEPS CAddon::GetDeps() +{ + return CAddonMgr::Get().GetDeps(ID()); +} + /** * CAddonLibrary * diff --git a/xbmc/addons/Addon.h b/xbmc/addons/Addon.h index 0fa4c48d5d..7ff9c14242 100644 --- a/xbmc/addons/Addon.h +++ b/xbmc/addons/Addon.h @@ -147,7 +147,7 @@ public: const int Stars() const { return m_props.stars; } const CStdString Disclaimer() const { return m_props.disclaimer; } bool Supports(const CONTENT_TYPE &content) const { return (m_props.contents.count(content) == 1); } - ADDONDEPS& GetDeps() { return m_props.dependencies; } + ADDONDEPS GetDeps(); protected: CAddon(const CAddon&); // protected as all copying is handled by Clone() diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp index b34a8fb8aa..256b187b81 100644 --- a/xbmc/addons/AddonManager.cpp +++ b/xbmc/addons/AddonManager.cpp @@ -341,6 +341,7 @@ bool CAddonMgr::GetAddon(const CStdString &str, AddonPtr &addon, const TYPE &typ && type != ADDON_REPOSITORY && type != ADDON_SCRIPT && type != ADDON_SCRAPER + && type != ADDON_SCRAPER_LIBRARY && m_addons.find(type) == m_addons.end()) return false; @@ -1006,6 +1007,23 @@ const cp_extension_t *CAddonMgr::GetExtension(const cp_plugin_info_t *props, con return NULL; } +ADDONDEPS CAddonMgr::GetDeps(const CStdString &id) +{ + ADDONDEPS result; + cp_status_t status; + + cp_plugin_info_t *info = m_cpluff->get_plugin_info(m_cp_context,id.c_str(),&status); + if (info) + { + for (unsigned int i=0;i<info->num_imports;++i) + result.insert(make_pair(CStdString(info->imports[i].plugin_id), + make_pair(AddonVersion(info->version), + AddonVersion(info->version)))); + } + + return result; +} + CStdString CAddonMgr::GetExtValue(cp_cfg_element_t *base, const char *path) { const char *value = NULL; @@ -1014,6 +1032,16 @@ CStdString CAddonMgr::GetExtValue(cp_cfg_element_t *base, const char *path) else return CStdString(); } +vector<CStdString> CAddonMgr::GetExtValues(cp_cfg_element_t *base, const char *path) +{ + vector<CStdString> result; + cp_cfg_element_t *parent = m_cpluff->lookup_cfg_element(base,path); + for (unsigned int i=0;parent && i<parent->num_children;++i) + result.push_back(parent->children[i].value); + + return result; +} + bool CAddonMgr::LoadAddonDescription(const CStdString &path, AddonPtr &addon) { cp_status_t status; diff --git a/xbmc/addons/AddonManager.h b/xbmc/addons/AddonManager.h index 7a08b1a2c4..cd8d263689 100644 --- a/xbmc/addons/AddonManager.h +++ b/xbmc/addons/AddonManager.h @@ -104,6 +104,7 @@ namespace ADDON /* libcpluff */ CStdString GetExtValue(cp_cfg_element_t *base, const char *path); + std::vector<CStdString> GetExtValues(cp_cfg_element_t *base, const char *path); const cp_extension_t *GetExtension(const cp_plugin_info_t *props, const char *extension); /*! \brief Load the addon in the given path @@ -121,7 +122,7 @@ namespace ADDON \return true if the repository XML file is parsed, false otherwise. */ bool AddonsFromRepoXML(const TiXmlElement *root, VECADDONS &addons); - + ADDONDEPS GetDeps(const CStdString& id); private: void LoadAddons(const CStdString &path, std::map<CStdString, AddonPtr>& unresolved); diff --git a/xbmc/addons/IAddon.h b/xbmc/addons/IAddon.h index e8a6cbef16..b9a541a3ea 100644 --- a/xbmc/addons/IAddon.h +++ b/xbmc/addons/IAddon.h @@ -104,7 +104,7 @@ namespace ADDON virtual CStdString GetSetting(const CStdString& key) const =0; virtual TiXmlElement* GetSettingsXML() =0; virtual CStdString GetString(uint32_t id) =0; - virtual ADDONDEPS& GetDeps() =0; + virtual ADDONDEPS GetDeps() =0; private: friend class CAddonMgr; diff --git a/xbmc/utils/ScraperParser.cpp b/xbmc/utils/ScraperParser.cpp index 68ec3c3725..8d27936c71 100644 --- a/xbmc/utils/ScraperParser.cpp +++ b/xbmc/utils/ScraperParser.cpp @@ -21,10 +21,6 @@ #include "ScraperParser.h" -#ifdef _LINUX -#include "system.h" -#endif - #include "addons/AddonManager.h" #include "RegExp.h" #include "HTMLUtil.h" @@ -127,6 +123,7 @@ bool CScraperParser::LoadFromXML() m_pRootElement = m_document->RootElement(); CStdString strValue = m_pRootElement->Value(); + bool result=false; if (strValue == "scraper") { if (m_pRootElement->Attribute("cachePersistence")) @@ -146,12 +143,14 @@ bool CScraperParser::LoadFromXML() ADDONDEPS::iterator itr = deps.begin(); while (itr != deps.end()) { - AddonPtr dep; - if (!CAddonMgr::Get().GetAddon((*itr).first, dep, ADDON_SCRAPER_LIBRARY, false)) + if (itr->first.Equals("xbmc.metadata")) { - itr++; + ++itr; continue; - } + } + AddonPtr dep; + if (!CAddonMgr::Get().GetAddon((*itr).first, dep)) + break; CStdString strFile = CUtil::AddFileToFolder(dep->Path(), dep->LibName()); TiXmlDocument doc; if (doc.LoadFile(strFile)) @@ -165,8 +164,12 @@ bool CScraperParser::LoadFromXML() } itr++; } - return true; + result = true; } + + if (result) + return true; + delete m_document; m_document = NULL; m_pRootElement = NULL; |