Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
changed: renamed UUID to ID. we now accept any string as an identifier,
Browse files Browse the repository at this point in the history
choose wisely..

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28348 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
alcoheca committed Mar 3, 2010
1 parent 5e9f9b8 commit 7411555
Show file tree
Hide file tree
Showing 39 changed files with 126 additions and 118 deletions.
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/AllMusic/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>49acf415-02ad-4281-8eb4-9278326f4a05</uuid>
<id>49acf415-02ad-4281-8eb4-9278326f4a05</id>
<type>scraper-library</type>
<title>AllMusic</title>
<library>allmusic.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/DTrailer/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>79ba05df-14b0-49ba-ad8d-b9eb8cafd038</uuid>
<id>79ba05df-14b0-49ba-ad8d-b9eb8cafd038</id>
<type>scraper-library</type>
<title>DTrailer</title>
<library>dtrailer.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/Discogs/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>182db4b0-25ae-11df-8a39-0800200c9a66</uuid>
<id>182db4b0-25ae-11df-8a39-0800200c9a66</id>
<type>scraper-library</type>
<title>Discogs</title>
<library>discogs.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/HTBackDrops/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>20a6cd29-50f3-41c5-bd96-c9f967138365</uuid>
<id>20a6cd29-50f3-41c5-bd96-c9f967138365</id>
<type>scraper-library</type>
<title>HTBackdrops</title>
<library>htbackdrops.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/IMDB/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>208d94d7-5c65-4b96-b207-e6b308717623</uuid>
<id>208d94d7-5c65-4b96-b207-e6b308717623</id>
<type>scraper-library</type>
<title>IMDb</title>
<library>imdb.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/IMPA/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>3cfce449-2e54-4a40-86cc-a6d2199c73b3</uuid>
<id>3cfce449-2e54-4a40-86cc-a6d2199c73b3</id>
<type>scraper-library</type>
<title>IMPA</title>
<library>impa.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/LastFM/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>56e2e02c-1b76-4c91-87bb-0e90b1cb7c72</uuid>
<id>56e2e02c-1b76-4c91-87bb-0e90b1cb7c72</id>
<type>scraper-library</type>
<title>LastFM</title>
<library>lastfm.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/MoviePosterDB/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>DD60AE50-5D67-4aa9-AF45-A7F2E5518B5F</uuid>
<id>DD60AE50-5D67-4aa9-AF45-A7F2E5518B5F</id>
<type>scraper-library</type>
<title>MoviePostersDB</title>
<library>movieposterdb.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/libraries/scrapers/TMDB/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>52f01b59-f059-4950-a133-dbd778fa9b23</uuid>
<id>52f01b59-f059-4950-a133-dbd778fa9b23</id>
<type>scraper-library</type>
<title>TMDB</title>
<library>tmdb.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/scrapers/AllMusic/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>6306e0c0-25f3-11df-8a39-0800200c9a66</uuid>
<id>6306e0c0-25f3-11df-8a39-0800200c9a66</id>
<type>scraper</type>
<title>AllMusic</title>
<library>allmusic.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/scrapers/AmazonUK/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>F0B735CA-F693-48e6-99DA-B3A66AE56E88</uuid>
<id>F0B735CA-F693-48e6-99DA-B3A66AE56E88</id>
<type>scraper</type>
<title>Amazon UK</title>
<library>amazonuk.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/scrapers/IMDB/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>2F2B9322-10BC-46f2-AC4C-72B2E8DD9694</uuid>
<id>2F2B9322-10BC-46f2-AC4C-72B2E8DD9694</id>
<type>scraper</type>
<title>IMDb</title>
<library>imdb.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/scrapers/LastFM/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>DD60AE50-5D67-4aa9-AF45-A7F2E5518B5F</uuid>
<id>DD60AE50-5D67-4aa9-AF45-A7F2E5518B5F</id>
<type>scraper</type>
<title>LastFM</title>
<library>lastfm.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/scrapers/YahooMusic/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>EA0E975F-F57F-467a-B77B-2A9CC597873B</uuid>
<id>EA0E975F-F57F-467a-B77B-2A9CC597873B</id>
<type>scraper</type>
<title>Yahoo! Music</title>
<library>yahoomusic.xml</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/screensavers/Euphoria/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>F1179D67-0B7A-40f9-9EF6-27AD0E2C372B</uuid>
<id>F1179D67-0B7A-40f9-9EF6-27AD0E2C372B</id>
<type>screensaver</type>
<title>Euphoria</title>
<library>Euphoria.xbs</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/screensavers/Plasma/description.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<!-- guid: unique identifier of this addon !-->
<uuid>F20BE86C-7EA9-4b79-BE92-9BF3311EC092</uuid>
<id>F20BE86C-7EA9-4b79-BE92-9BF3311EC092</id>
<type>screensaver</type>
<title>Plasma</title>
<library>Plasma.xbs</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/screensavers/Solarwinds/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>B74613E6-B833-42c0-A8F7-21ACEA51628E</uuid>
<id>B74613E6-B833-42c0-A8F7-21ACEA51628E</id>
<type>screensaver</type>
<title>Solarwinds</title>
<library>Solarwinds.xbs</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/visualizations/DXSpectrum/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>7A4551D9-2F50-4173-B224-EE209FC9EB1F</uuid>
<id>7A4551D9-2F50-4173-B224-EE209FC9EB1F</id>
<type>visualization</type>
<title>DirectX Spectrum</title>
<librarywin32>directx_spectrum_win32.vis</librarywin32>
Expand Down
2 changes: 1 addition & 1 deletion addons/visualizations/GLSpectrum/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>7A4551D9-2F50-4173-B224-EE209FC9EB1F</uuid>
<id>7A4551D9-2F50-4173-B224-EE209FC9EB1F</id>
<type>visualization</type>
<title>OpenGL Spectrum</title>
<library>opengl_spectrum.vis</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/visualizations/ProjectM/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>b67a5960-d956-11de-8a39-0800200c9a66</uuid>
<id>b67a5960-d956-11de-8a39-0800200c9a66</id>
<type>visualization</type>
<title>projectM</title>
<library>projectM.vis</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/visualizations/Waveform/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>9AFC128B-A6B6-4824-9BC4-B122966709B3</uuid>
<id>9AFC128B-A6B6-4824-9BC4-B122966709B3</id>
<type>visualization</type>
<title>Waveform</title>
<library>Waveform.vis</library>
Expand Down
2 changes: 1 addition & 1 deletion addons/visualizations/iTunes/description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<uuid>57675d11-0ae3-11df-8a39-0800200c9a66</uuid>
<id>57675d11-0ae3-11df-8a39-0800200c9a66</id>
<type>visualization</type>
<title>iTunes Visualization</title>
<library>iTunes.mvis</library>
Expand Down
8 changes: 4 additions & 4 deletions guilib/GUIInfoTypes.cpp
Expand Up @@ -226,7 +226,7 @@ CStdString CGUIInfoLabel::ReplaceLocalize(const CStdString &label)
CStdString CGUIInfoLabel::ReplaceAddonStrings(const CStdString &label)
{
CStdString work(label);
// Replace all $ADDON[uuid number] with the real string
// Replace all $ADDON[id number] with the real string
int pos1 = work.Find("$ADDON[");
while (pos1 >= 0)
{
Expand All @@ -235,9 +235,9 @@ CStdString CGUIInfoLabel::ReplaceAddonStrings(const CStdString &label)
{
CStdString left = work.Left(pos1);
CStdString right = work.Mid(pos2 + 1);
CStdString uuid = work.substr(pos1+7, 36);
CStdString id = work.substr(pos1+7, 36);
int stringid = atoi(work.substr(pos1+7+36+1, 5).c_str());
CStdString replace = CAddonMgr::Get()->GetString(uuid, stringid);
CStdString replace = CAddonMgr::Get()->GetString(id, stringid);
work = left + replace + right;
}
else
Expand All @@ -255,7 +255,7 @@ void CGUIInfoLabel::Parse(const CStdString &label)
m_info.clear();
// Step 1: Replace all $LOCALIZE[number] with the real string
CStdString work = ReplaceLocalize(label);
// Step 2: Replace all $ADDON[uuid number] with the real string
// Step 2: Replace all $ADDON[id number] with the real string
work = ReplaceAddonStrings(work);
// Step 3: Find all $INFO[info,prefix,postfix] blocks
int pos1 = work.Find("$INFO[");
Expand Down
2 changes: 1 addition & 1 deletion guilib/GUIInfoTypes.h
Expand Up @@ -90,7 +90,7 @@ class CGUIInfoLabel
static CStdString ReplaceLocalize(const CStdString &label);

/*!
\brief Replaces instances of $ADDON[uuid number] with the appropriate localized addon string
\brief Replaces instances of $ADDON[id number] with the appropriate localized addon string
\param label text to replace
\return text with any localized strings filled in.
*/
Expand Down
2 changes: 1 addition & 1 deletion xbmc/FileSystem/AddonsDirectory.cpp
Expand Up @@ -64,7 +64,7 @@ void CAddonsDirectory::GenerateListing(CURL &path, VECADDONS& addons, CFileItemL
for (unsigned i=0; i < addons.size(); i++)
{
AddonPtr addon = addons[i];
path.SetFileName(addon->UUID());
path.SetFileName(addon->ID());
CFileItemPtr pItem(new CFileItem(path.Get(), false));
pItem->SetLabel(addon->Name());
pItem->SetLabel2(addon->Summary());
Expand Down
2 changes: 1 addition & 1 deletion xbmc/FileSystem/PluginDirectory.cpp
Expand Up @@ -445,7 +445,7 @@ bool CPluginDirectory::GetPluginsDirectory(const CONTENT_TYPE &type, CFileItemLi
for (IVECADDONS it = addons.begin(); it != addons.end(); it++)
{
CStdString path("plugin://");
path.append((*it)->UUID());
path.append((*it)->ID());

CFileItemPtr newItem(new CFileItem(path,true));
newItem->SetLabel((*it)->Name());
Expand Down
4 changes: 2 additions & 2 deletions xbmc/GUIDialogAddonSettings.cpp
Expand Up @@ -397,9 +397,9 @@ void CGUIDialogAddonSettings::CreateControls()
if (setting->Attribute("label") && atoi(setting->Attribute("label")) > 0)
{
if (m_addon->Parent())
label.Format("$ADDON[%s %s]", m_addon->Parent()->UUID().c_str(), setting->Attribute("label"));
label.Format("$ADDON[%s %s]", m_addon->Parent()->ID().c_str(), setting->Attribute("label"));
else
label.Format("$ADDON[%s %s]", m_addon->UUID().c_str(), setting->Attribute("label"));
label.Format("$ADDON[%s %s]", m_addon->ID().c_str(), setting->Attribute("label"));
}
else
label = setting->Attribute("label");
Expand Down
12 changes: 6 additions & 6 deletions xbmc/GUIDialogContentSettings.cpp
Expand Up @@ -248,19 +248,19 @@ void CGUIDialogContentSettings::FillContentTypes(const CONTENT_TYPE &content)
return;

AddonPtr addon;
CStdString defaultUUID;
CStdString defaultID;
CAddonMgr::Get()->GetDefault(ADDON_SCRAPER, addon, content);
if (addon)
defaultUUID = addon->UUID();
defaultID = addon->ID();

for (IVECADDONS it = addons.begin(); it != addons.end(); it++)
{
bool isDefault = ((*it)->UUID() == defaultUUID);
bool isDefault = ((*it)->ID() == defaultID);
map<CONTENT_TYPE,VECADDONS>::iterator iter=m_scrapers.find(content);

AddonPtr scraper = (*it)->Clone((*it));

if (m_scraper && m_scraper->Parent() && m_scraper->Parent()->UUID() == (*it)->UUID())
if (m_scraper && m_scraper->Parent() && m_scraper->Parent()->ID() == (*it)->ID())
{ // don't overwrite preconfigured scraper
scraper = m_scraper;
}
Expand Down Expand Up @@ -301,9 +301,9 @@ void CGUIDialogContentSettings::FillListControl()
for (IVECADDONS iter=m_scrapers.find(m_content)->second.begin();iter!=m_scrapers.find(m_content)->second.end();++iter)
{
CFileItemPtr item(new CFileItem((*iter)->Name()));
item->m_strPath = (*iter)->UUID();
item->m_strPath = (*iter)->ID();
item->SetThumbnailImage((*iter)->Icon());
if (m_scraper && (*iter)->UUID() == m_scraper->UUID())
if (m_scraper && (*iter)->ID() == m_scraper->ID())
{
item->Select(true);
selectedIndex = iIndex;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/GUIViewState.cpp
Expand Up @@ -353,7 +353,7 @@ VECSOURCES& CGUIViewState::GetSources()
CMediaSource plugin;
CURL path;
path.SetProtocol(ADDON::TranslateContent(m_content));
path.SetHostName(addons[i]->UUID());
path.SetHostName(addons[i]->ID());
plugin.strPath = path.Get();
plugin.strName = addons[i]->Name();
plugin.m_strThumbnailImage = addons[i]->Icon(); //FIXME cache by UUID
Expand Down
8 changes: 4 additions & 4 deletions xbmc/GUIWindowAddonBrowser.cpp
Expand Up @@ -140,9 +140,9 @@ void CGUIWindowAddonBrowser::Update()
for (unsigned i=0; i < addons.size(); i++)
{
AddonPtr addon = addons[i];
CFileItemPtr pItem(new CFileItem(addon->UUID(), false));
CFileItemPtr pItem(new CFileItem(addon->ID(), false));
pItem->SetLabel(addon->Name());
pItem->SetProperty("Addon.UUID", addon->UUID());
pItem->SetProperty("Addon.ID", addon->ID());
pItem->SetProperty("Addon.Type", TranslateType(addon->Type()));
pItem->SetProperty("Addon.Disabled", addon->Disabled());
pItem->SetProperty("Addon.Name", addon->Name());
Expand Down Expand Up @@ -177,7 +177,7 @@ void CGUIWindowAddonBrowser::OnClick(int iItem)

AddonPtr addon;
TYPE type = TranslateType(pItem->GetProperty("Addon.Type"));
if (CAddonMgr::Get()->GetAddon(type, pItem->GetProperty("Addon.UUID"), addon))
if (CAddonMgr::Get()->GetAddon(type, pItem->GetProperty("Addon.ID"), addon))
{
if (addon->Disabled())
{
Expand Down Expand Up @@ -206,7 +206,7 @@ bool CGUIWindowAddonBrowser::OnContextMenu(int iItem)

TYPE type = TranslateType(pItem->GetProperty("Addon.Type"));
AddonPtr addon;
if (!CAddonMgr::Get()->GetAddon(type, pItem->GetProperty("Addon.UUID"), addon))
if (!CAddonMgr::Get()->GetAddon(type, pItem->GetProperty("Addon.ID"), addon))
return false;

int iSettingsLabel = 24020;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/MusicDatabase.cpp
Expand Up @@ -4022,7 +4022,7 @@ bool CMusicDatabase::SetScraperForPath(const CStdString& strPath, const ADDON::S

// insert new settings
strSQL = FormatSQL("insert into content (strPath, strScraperPath, strContent, strSettings) values ('%s','%s','%s','%s')",
strPath.c_str(), scraper->Parent()->UUID().c_str(), ADDON::TranslateContent(scraper->Content()).c_str(), scraper->GetSettings().c_str());
strPath.c_str(), scraper->Parent()->ID().c_str(), ADDON::TranslateContent(scraper->Content()).c_str(), scraper->GetSettings().c_str());
m_pDS->exec(strSQL.c_str());

return true;
Expand Down
6 changes: 3 additions & 3 deletions xbmc/Scraper.cpp
Expand Up @@ -86,15 +86,15 @@ bool CScraper::LoadUserXML(const CStdString& strSaved)

bool CScraper::LoadSettingsXML(const CStdString& strFunction, const CScraperUrl* url)
{
CStdString uuid = UUID();
CStdString id = ID();
if (Parent())
{ // called from DialogContentSettings. We are working with the cloned scraper settings
uuid = Parent()->UUID();
id = Parent()->ID();
}

// load our scraper xml
CScraperParser parser;
if (!parser.Load(uuid))
if (!parser.Load(id))
return false;

if (!parser.HasFunction(strFunction))
Expand Down
4 changes: 2 additions & 2 deletions xbmc/VideoDatabase.cpp
Expand Up @@ -3237,7 +3237,7 @@ void CVideoDatabase::SetScraperForPath(const CStdString& filePath, const Scraper
else
{
CStdString content = TranslateContent(scraper->Content());
strSQL=FormatSQL("update path set strContent='%s', strScraper='%s', scanRecursive=%i, useFolderNames=%i, strSettings='%s', noUpdate=%i where idPath=%i", content.c_str(), scraper->UUID().c_str(),settings.recurse,settings.parent_name,scraper->GetSettings().c_str(),settings.noupdate, idPath);
strSQL=FormatSQL("update path set strContent='%s', strScraper='%s', scanRecursive=%i, useFolderNames=%i, strSettings='%s', noUpdate=%i where idPath=%i", content.c_str(), scraper->ID().c_str(),settings.recurse,settings.parent_name,scraper->GetSettings().c_str(),settings.noupdate, idPath);
}
m_pDS->exec(strSQL.c_str());
}
Expand Down Expand Up @@ -7444,7 +7444,7 @@ void CVideoDatabase::ExportToXML(const CStdString &path, bool singleFiles /* = f
XMLUtils::SetInt(pPath,"scanrecursive",iter->second.recurse);
XMLUtils::SetBoolean(pPath,"usefoldernames",iter->second.parent_name);
XMLUtils::SetString(pPath,"content", TranslateContent(info->Content()));
XMLUtils::SetString(pPath,"scraperpath",info->UUID());
XMLUtils::SetString(pPath,"scraperpath",info->ID());
}
}
xmlDoc.SaveFile(xmlFile);
Expand Down
4 changes: 2 additions & 2 deletions xbmc/utils/Addon.cpp
Expand Up @@ -235,7 +235,7 @@ CAddon::CAddon(const CAddon &rhs, const AddonPtr &parent)
: m_props(rhs.Props())
, m_parent(parent)
{
m_props.uuid = StringUtils::CreateUUID();
m_props.id = StringUtils::CreateUUID();
m_userXmlDoc = rhs.m_userXmlDoc;
BuildProfilePath();
CUtil::AddFileToFolder(Profile(), "settings.xml", m_userSettingsPath);
Expand Down Expand Up @@ -503,7 +503,7 @@ TiXmlElement* CAddon::GetSettingsXML()

void CAddon::BuildProfilePath()
{
m_profile.Format("special://profile/addon_data/%s/", UUID().c_str());
m_profile.Format("special://profile/addon_data/%s/", ID().c_str());
}

/**
Expand Down

0 comments on commit 7411555

Please sign in to comment.