diff options
author | topfs2 <topfs2@svn> | 2010-05-03 18:14:34 +0000 |
---|---|---|
committer | topfs2 <topfs2@svn> | 2010-05-03 18:14:34 +0000 |
commit | c802649792e211fc7f9ef29890784d8b00b92dbc (patch) | |
tree | 2c27627f9d6274a5f82ba95504b09d1efc837edc | |
parent | 23a144cd79787cdf25dd31110a60fccca279d040 (diff) |
If no type is specified in Files.GetDirectory assume files
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29755 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | xbmc/lib/libjsonrpc/FileOperations.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/xbmc/lib/libjsonrpc/FileOperations.cpp b/xbmc/lib/libjsonrpc/FileOperations.cpp index 4913ff0474..04fa42da7f 100644 --- a/xbmc/lib/libjsonrpc/FileOperations.cpp +++ b/xbmc/lib/libjsonrpc/FileOperations.cpp @@ -57,9 +57,17 @@ JSON_STATUS CFileOperations::GetRootDirectory(const CStdString &method, ITranspo JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Value ¶meterObject, Value &result) { - if (parameterObject.isObject() && parameterObject.isMember("type") && parameterObject.isMember("directory")) - { - CStdString type = parameterObject.get("type", "files").asString(); + if (parameterObject.isObject() && parameterObject.isMember("directory")) + { + CStdString type = "files"; + if (parameterObject.isMember("type")) + { + if (parameterObject["type"].isString()) + type = parameterObject["type"].asString(); + else + return InvalidParams; + } + type = type.ToLower(); if (type.Equals("video") || type.Equals("music") || type.Equals("pictures") || type.Equals("files") || type.Equals("programs")) |