diff options
author | Martijn Kaijser <machine.sanctum@gmail.com> | 2014-11-30 12:03:11 +0100 |
---|---|---|
committer | Martijn Kaijser <machine.sanctum@gmail.com> | 2014-11-30 12:03:11 +0100 |
commit | fd114cba14e7346baf3531c2e2b995cbbb672317 (patch) | |
tree | 324fd2c399268dc1f175de5b54f2a2af4b556dd1 | |
parent | 55a295a94f70cf5064365ad665c018e3806b4752 (diff) | |
parent | 19cf2fdfde08717ae20f6915586db84db995a965 (diff) |
Merge pull request #5845 from Montellese/jsonrpc_fix_files_getdirectory_smartplaylists
jsonrpc: fix Files.GetDirectory not returning artistid, albumartistid and genreid for smartplaylists
-rw-r--r-- | xbmc/interfaces/json-rpc/AudioLibrary.cpp | 14 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/AudioLibrary.h | 1 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/FileOperations.cpp | 8 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/schema/version.txt | 2 |
4 files changed, 24 insertions, 1 deletions
diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.cpp b/xbmc/interfaces/json-rpc/AudioLibrary.cpp index a32d56a59a..4ffcde9387 100644 --- a/xbmc/interfaces/json-rpc/AudioLibrary.cpp +++ b/xbmc/interfaces/json-rpc/AudioLibrary.cpp @@ -651,6 +651,20 @@ void CAudioLibrary::FillAlbumItem(const CAlbum &album, const std::string &path, item = CFileItemPtr(new CFileItem(path, album)); } +JSONRPC_STATUS CAudioLibrary::GetAdditionalDetails(const CVariant ¶meterObject, CFileItemList &items) +{ + if (items.IsEmpty()) + return OK; + + CMusicDatabase musicdb; + if (MediaTypes::IsMediaType(items.GetContent(), MediaTypeAlbum)) + return GetAdditionalAlbumDetails(parameterObject, items, musicdb); + else if (MediaTypes::IsMediaType(items.GetContent(), MediaTypeSong)) + return GetAdditionalSongDetails(parameterObject, items, musicdb); + + return OK; +} + JSONRPC_STATUS CAudioLibrary::GetAdditionalAlbumDetails(const CVariant ¶meterObject, CFileItemList &items, CMusicDatabase &musicdatabase) { if (!musicdatabase.Open()) diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.h b/xbmc/interfaces/json-rpc/AudioLibrary.h index 5d6113f158..7b73a67369 100644 --- a/xbmc/interfaces/json-rpc/AudioLibrary.h +++ b/xbmc/interfaces/json-rpc/AudioLibrary.h @@ -55,6 +55,7 @@ namespace JSONRPC static bool FillFileItem(const std::string &strFilename, CFileItemPtr &item, const CVariant ¶meterObject = CVariant(CVariant::VariantTypeArray)); static bool FillFileItemList(const CVariant ¶meterObject, CFileItemList &list); + static JSONRPC_STATUS GetAdditionalDetails(const CVariant ¶meterObject, CFileItemList &items); static JSONRPC_STATUS GetAdditionalAlbumDetails(const CVariant ¶meterObject, CFileItemList &items, CMusicDatabase &musicdatabase); static JSONRPC_STATUS GetAdditionalSongDetails(const CVariant ¶meterObject, CFileItemList &items, CMusicDatabase &musicdatabase); diff --git a/xbmc/interfaces/json-rpc/FileOperations.cpp b/xbmc/interfaces/json-rpc/FileOperations.cpp index 50e74e1c19..6ba9d6e4c8 100644 --- a/xbmc/interfaces/json-rpc/FileOperations.cpp +++ b/xbmc/interfaces/json-rpc/FileOperations.cpp @@ -103,6 +103,14 @@ JSONRPC_STATUS CFileOperations::GetDirectory(const std::string &method, ITranspo if (CDirectory::GetDirectory(strPath, items, extensions)) { + // we might need to get additional information for music items + if (media == "music") + { + JSONRPC_STATUS status = CAudioLibrary::GetAdditionalDetails(parameterObject, items); + if (status != OK) + return status; + } + CFileItemList filteredFiles; for (unsigned int i = 0; i < (unsigned int)items.Size(); i++) { diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt index 476d3ceb74..facac91deb 100644 --- a/xbmc/interfaces/json-rpc/schema/version.txt +++ b/xbmc/interfaces/json-rpc/schema/version.txt @@ -1 +1 @@ -6.21.1 +6.21.2 |