Skip to content

Commit

Permalink
Add musicdb:// resolving in Application.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
tidalf committed Dec 9, 2012
1 parent 737dda6 commit 5c1439a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion xbmc/Application.cpp
Expand Up @@ -76,6 +76,7 @@
#include "filesystem/SpecialProtocol.h" #include "filesystem/SpecialProtocol.h"
#include "filesystem/DllLibCurl.h" #include "filesystem/DllLibCurl.h"
#include "filesystem/MythSession.h" #include "filesystem/MythSession.h"
#include "filesystem/MusicDatabaseFile.h"
#include "filesystem/PluginDirectory.h" #include "filesystem/PluginDirectory.h"
#ifdef HAS_FILESYSTEM_SAP #ifdef HAS_FILESYSTEM_SAP
#include "filesystem/SAPDirectory.h" #include "filesystem/SAPDirectory.h"
Expand Down Expand Up @@ -3878,6 +3879,18 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)
return false; return false;
} }


// resolve MusicDb url, needed to resolve plugin items in music database
if (item.IsMusicDb())
{
CURL url(item.GetPath());
if (CStdString mainFile = CMusicDatabaseFile::TranslateUrl(url))
{
CFileItem item_new(mainFile,false);
return PlayFile(item_new, false);
}
return false;
}

#ifdef HAS_UPNP #ifdef HAS_UPNP
if (URIUtils::IsUPnP(item.GetPath())) if (URIUtils::IsUPnP(item.GetPath()))
{ {
Expand Down Expand Up @@ -4849,8 +4862,10 @@ bool CApplication::OnMessage(CGUIMessage& message)


// ok, grab the next song // ok, grab the next song
CFileItem file(*playlist[iNext]); CFileItem file(*playlist[iNext]);
// handle plugin:// // handle plugin:// and musicdb://
CURL url(file.GetPath()); CURL url(file.GetPath());
if (url.GetProtocol() == "musicdb" )
url = CMusicDatabaseFile::TranslateUrl(url);
if (url.GetProtocol() == "plugin") if (url.GetProtocol() == "plugin")
XFILE::CPluginDirectory::GetPluginResult(url.Get(), file); XFILE::CPluginDirectory::GetPluginResult(url.Get(), file);


Expand Down

0 comments on commit 5c1439a

Please sign in to comment.