Skip to content

Commit

Permalink
Don't touch plugin:// urls
Browse files Browse the repository at this point in the history
  • Loading branch information
mediaminister committed Jun 17, 2020
1 parent c6d47fe commit 66432ac
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions xbmc/windows/GUIMediaWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,7 @@ bool CGUIMediaWindow::OnMessage(CGUIMessage& message)
{
if (m_vecItems->GetPath() == "?")
m_vecItems->SetPath("");
std::string path, fileName;
std::string dir = message.GetStringParam(0);
URIUtils::Split(dir, path, fileName);
URIUtils::RemoveExtension(fileName);
if (StringUtils::IsInteger(fileName))
dir = path;
const std::string &ret = message.GetStringParam(1);
bool returning = StringUtils::EqualsNoCase(ret, "return");
if (!dir.empty())
Expand Down Expand Up @@ -2175,6 +2170,21 @@ std::string CGUIMediaWindow::GetStartFolder(const std::string &dir)
StringUtils::EqualsNoCase(dir, "root"))
return "";

// Let plugins handle their own urls themselves
if (StringUtils::StartsWith(dir, "plugin://"))
return dir;

//! @todo This ifdef block probably belongs somewhere else. Move it to a better place!
#if defined(TARGET_ANDROID)
// Hack for Android items (numbered id's) on the leanback screen
std::string path;
std::string fileName;
URIUtils::Split(dir, path, fileName);
URIUtils::RemoveExtension(fileName);
if (StringUtils::IsInteger(fileName))
return path;
#endif

return dir;
}

Expand Down

0 comments on commit 66432ac

Please sign in to comment.