Browse files

URIUtils: add support for filtered musicdb and videodb paths in GetPa…

…renPath()
  • Loading branch information...
1 parent d44891b commit df330ab0a4f3a6e839aa3782059b5921a67dadec @Montellese committed Sep 11, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 xbmc/utils/URIUtils.cpp
View
16 xbmc/utils/URIUtils.cpp
@@ -267,6 +267,22 @@ bool URIUtils::GetParentPath(const CStdString& strPath, CStdString& strParent)
strFile = url.GetHostName();
return GetParentPath(strFile, strParent);
}
+ else if ((url.GetProtocol() == "videodb" || url.GetProtocol() == "musicdb") && !url.GetOptions().empty())
+ {
+ CStdString options = url.GetOptions();
+ size_t filterStart = options.find("filter=");
+ if (filterStart != string::npos)
+ {
+ size_t filterEnd = options.find("&", filterStart);
+ options.erase(filterStart, filterEnd - filterStart);
+ if (options.Equals("?"))
+ options.clear();
+
+ url.SetOptions(options);
+ strParent = url.Get();
+ return true;
+ }
+ }
else if (url.GetProtocol() == "stack")
{
CStackDirectory dir;

0 comments on commit df330ab

Please sign in to comment.