Skip to content
This repository
Browse code

Merge pull request #1785 from Montellese/custom_nodes_location

custom library node cleanup
  • Loading branch information...
commit b7c3ce0f0409c13662b653b0e6234da7aa152405 2 parents 5ff18cb + 5ad6f11
Sascha Montellese authored November 16, 2012
2  xbmc/filesystem/LibraryDirectory.cpp
@@ -172,7 +172,7 @@ bool CLibraryDirectory::Exists(const char* strPath)
172 172
 CStdString CLibraryDirectory::GetNode(const CStdString &path)
173 173
 {
174 174
   CURL url(path);
175  
-  CStdString libDir = URIUtils::AddFileToFolder(g_settings.GetDatabaseFolder(), url.GetHostName() + "/");
  175
+  CStdString libDir = URIUtils::AddFileToFolder(g_settings.GetLibraryFolder(), url.GetHostName() + "/");
176 176
   if (!CDirectory::Exists(libDir))
177 177
     libDir = URIUtils::AddFileToFolder("special://xbmc/system/library/", url.GetHostName() + "/");
178 178
 
12  xbmc/settings/Settings.cpp
@@ -1746,6 +1746,17 @@ CStdString CSettings::GetBookmarksThumbFolder() const
1746 1746
   return folder;
1747 1747
 }
1748 1748
 
  1749
+CStdString CSettings::GetLibraryFolder() const
  1750
+{
  1751
+  CStdString folder;
  1752
+  if (GetCurrentProfile().hasDatabases())
  1753
+    URIUtils::AddFileToFolder(GetProfileUserDataFolder(), "library", folder);
  1754
+  else
  1755
+    URIUtils::AddFileToFolder(GetUserDataFolder(), "library", folder);
  1756
+
  1757
+  return folder;
  1758
+}
  1759
+
1749 1760
 CStdString CSettings::GetSourcesFile() const
1750 1761
 {
1751 1762
   CStdString folder;
@@ -1844,6 +1855,7 @@ void CSettings::CreateProfileFolders()
1844 1855
   }
1845 1856
   CDirectory::Create("special://profile/addon_data");
1846 1857
   CDirectory::Create("special://profile/keymaps");
  1858
+  CDirectory::Create(GetLibraryFolder());
1847 1859
 }
1848 1860
 
1849 1861
 static CProfile emptyProfile;
1  xbmc/settings/Settings.h
@@ -342,6 +342,7 @@ class CSettings
342 342
   CStdString GetThumbnailsFolder() const;
343 343
   CStdString GetVideoThumbFolder() const;
344 344
   CStdString GetBookmarksThumbFolder() const;
  345
+  CStdString GetLibraryFolder() const;
345 346
   CStdString GetSourcesFile() const;
346 347
 
347 348
   CStdString GetSettingsFile() const;

0 notes on commit b7c3ce0

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