aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortopfs2 <topfs2@svn>2010-05-06 23:14:06 +0000
committertopfs2 <topfs2@svn>2010-05-06 23:14:06 +0000
commit50d10703bf99896caf56783cf7bc31ba524d8922 (patch)
treefff6901ec2566a494d7547c101b5ab8c58eb414e
parent17ddc7ef82d56b11ccea4602a5525a4242d99972 (diff)
Moved from type to media in Files.GetFoo
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29858 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--web/poc_jsonrpc/musicfiles.html4
-rw-r--r--web/poc_jsonrpc/videofiles.html4
-rw-r--r--xbmc/lib/libjsonrpc/FileOperations.cpp26
3 files changed, 17 insertions, 17 deletions
diff --git a/web/poc_jsonrpc/musicfiles.html b/web/poc_jsonrpc/musicfiles.html
index eab6ef95e1..d7019ec242 100644
--- a/web/poc_jsonrpc/musicfiles.html
+++ b/web/poc_jsonrpc/musicfiles.html
@@ -42,9 +42,9 @@ var http_request = new XMLHttpRequest();
http_request.open( "POST", "jsonrpc", false );
if (directory)
- http_request.send('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": { "type": "music", "directory": "' + Url.decode(directory) + '", "sortmethod": "label", "sortorder": "ascending" }, "id": 1}');
+ http_request.send('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": { "media": "music", "directory": "' + Url.decode(directory) + '", "sortmethod": "label", "sortorder": "ascending" }, "id": 1}');
else
- http_request.send('{"jsonrpc": "2.0", "method": "Files.GetSources", "params": { "type": "music" }, "id": 1}');
+ http_request.send('{"jsonrpc": "2.0", "method": "Files.GetSources", "params": { "media": "music" }, "id": 1}');
var the_object = JSON.parse(http_request.responseText);
diff --git a/web/poc_jsonrpc/videofiles.html b/web/poc_jsonrpc/videofiles.html
index 6cac0073f7..256c42bd69 100644
--- a/web/poc_jsonrpc/videofiles.html
+++ b/web/poc_jsonrpc/videofiles.html
@@ -42,9 +42,9 @@ var http_request = new XMLHttpRequest();
http_request.open( "POST", "jsonrpc", false );
if (directory)
- http_request.send('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": { "type": "video", "directory": "' + unescape(directory) + '" }, "id": 1}');
+ http_request.send('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": { "media": "video", "directory": "' + unescape(directory) + '" }, "id": 1}');
else
- http_request.send('{"jsonrpc": "2.0", "method": "Files.GetSources", "params": { "type": "video" }, "id": 1}');
+ http_request.send('{"jsonrpc": "2.0", "method": "Files.GetSources", "params": { "media": "video" }, "id": 1}');
var the_object = JSON.parse(http_request.responseText);
diff --git a/xbmc/lib/libjsonrpc/FileOperations.cpp b/xbmc/lib/libjsonrpc/FileOperations.cpp
index 04fa42da7f..bd4f71c56f 100644
--- a/xbmc/lib/libjsonrpc/FileOperations.cpp
+++ b/xbmc/lib/libjsonrpc/FileOperations.cpp
@@ -34,12 +34,12 @@ using namespace JSONRPC;
JSON_STATUS CFileOperations::GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
{
const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue);
- CStdString type = param.get("type", "null").asString();
- type = type.ToLower();
+ CStdString media = param.get("media", "null").asString();
+ media = media.ToLower();
- if (type.Equals("video") || type.Equals("music") || type.Equals("pictures") || type.Equals("files") || type.Equals("programs"))
+ if (media.Equals("video") || media.Equals("music") || media.Equals("pictures") || media.Equals("files") || media.Equals("programs"))
{
- VECSOURCES *sources = g_settings.GetSourcesFromType(type);
+ VECSOURCES *sources = g_settings.GetSourcesFromType(media);
if (sources)
{
CFileItemList items;
@@ -59,18 +59,18 @@ JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLa
{
if (parameterObject.isObject() && parameterObject.isMember("directory"))
{
- CStdString type = "files";
- if (parameterObject.isMember("type"))
+ CStdString media = "files";
+ if (parameterObject.isMember("media"))
{
- if (parameterObject["type"].isString())
- type = parameterObject["type"].asString();
+ if (parameterObject["media"].isString())
+ media = parameterObject["media"].asString();
else
return InvalidParams;
}
- type = type.ToLower();
+ media = media.ToLower();
- if (type.Equals("video") || type.Equals("music") || type.Equals("pictures") || type.Equals("files") || type.Equals("programs"))
+ if (media.Equals("video") || media.Equals("music") || media.Equals("pictures") || media.Equals("files") || media.Equals("programs"))
{
CDirectory directory;
CFileItemList items;
@@ -80,11 +80,11 @@ JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLa
{
CStdStringArray regexps;
- if (type.Equals("video"))
+ if (media.Equals("video"))
regexps = g_advancedSettings.m_videoExcludeFromListingRegExps;
- else if (type.Equals("music"))
+ else if (media.Equals("music"))
regexps = g_advancedSettings.m_audioExcludeFromListingRegExps;
- else if (type.Equals("pictures"))
+ else if (media.Equals("pictures"))
regexps = g_advancedSettings.m_pictureExcludeFromListingRegExps;
CFileItemList filteredDirectories, filteredFiles;