Skip to content
This repository
Browse code

jsonrpc: fix Playlist.Add/Insert not working with "directory" (fixes …

…#14578)
  • Loading branch information...
commit 97c236ff469da8dc63394754f0e320d1893f0a1b 1 parent 72f100e
Sascha Montellese authored September 13, 2013
2  xbmc/interfaces/json-rpc/PlaylistOperations.cpp
@@ -97,7 +97,7 @@ JSONRPC_STATUS CPlaylistOperations::GetItems(const CStdString &method, ITranspor
97 97
 
98 98
 bool CPlaylistOperations::CheckMediaParameter(int playlist, const CVariant &parameterObject)
99 99
 {
100  
-  if (parameterObject["item"].isMember("media"))
  100
+  if (parameterObject["item"].isMember("media") && parameterObject["item"]["media"].asString().compare("files") != 0)
101 101
   {
102 102
     if (playlist == PLAYLIST_VIDEO && parameterObject["item"]["media"].asString().compare("video") != 0)
103 103
       return false;
4  xbmc/interfaces/json-rpc/ServiceDescription.h
@@ -22,7 +22,7 @@
22 22
 namespace JSONRPC
23 23
 {
24 24
   const char* const JSONRPC_SERVICE_ID          = "http://xbmc.org/jsonrpc/ServiceDescription.json";
25  
-  const char* const JSONRPC_SERVICE_VERSION     = "6.6.0";
  25
+  const char* const JSONRPC_SERVICE_VERSION     = "6.6.1";
26 26
   const char* const JSONRPC_SERVICE_DESCRIPTION = "JSON-RPC API of XBMC";
27 27
 
28 28
   const char* const JSONRPC_SERVICE_TYPES[] = {  
@@ -174,7 +174,7 @@ namespace JSONRPC
174 174
     "\"Playlist.Item\": {"
175 175
       "\"type\": ["
176 176
         "{ \"type\": \"object\", \"properties\": { \"file\": { \"type\": \"string\", \"description\": \"Path to a file (not a directory) to be added to the playlist\", \"required\": true } }, \"additionalProperties\": false },"
177  
-        "{ \"type\": \"object\", \"properties\": { \"directory\": { \"type\": \"string\", \"required\": true }, \"recursive\": { \"type\": \"boolean\", \"default\": false }, \"media\": { \"$ref\": \"Files.Media\" } }, \"additionalProperties\": false },"
  177
+        "{ \"type\": \"object\", \"properties\": { \"directory\": { \"type\": \"string\", \"required\": true }, \"recursive\": { \"type\": \"boolean\", \"default\": false }, \"media\": { \"$ref\": \"Files.Media\", \"default\": \"files\" } }, \"additionalProperties\": false },"
178 178
         "{ \"type\": \"object\", \"properties\": { \"movieid\": { \"$ref\": \"Library.Id\", \"required\": true } }, \"additionalProperties\": false },"
179 179
         "{ \"type\": \"object\", \"properties\": { \"episodeid\": { \"$ref\": \"Library.Id\", \"required\": true } }, \"additionalProperties\": false },"
180 180
         "{ \"type\": \"object\", \"properties\": { \"musicvideoid\": { \"$ref\": \"Library.Id\", \"required\": true } }, \"additionalProperties\": false },"
2  xbmc/interfaces/json-rpc/types.json
@@ -147,7 +147,7 @@
147 147
   "Playlist.Item": {
148 148
     "type": [
149 149
       { "type": "object", "properties": { "file": { "type": "string", "description": "Path to a file (not a directory) to be added to the playlist", "required": true } }, "additionalProperties": false },
150  
-      { "type": "object", "properties": { "directory": { "type": "string", "required": true }, "recursive": { "type": "boolean", "default": false }, "media": { "$ref": "Files.Media" } }, "additionalProperties": false },
  150
+      { "type": "object", "properties": { "directory": { "type": "string", "required": true }, "recursive": { "type": "boolean", "default": false }, "media": { "$ref": "Files.Media", "default": "files" } }, "additionalProperties": false },
151 151
       { "type": "object", "properties": { "movieid": { "$ref": "Library.Id", "required": true } }, "additionalProperties": false },
152 152
       { "type": "object", "properties": { "episodeid": { "$ref": "Library.Id", "required": true } }, "additionalProperties": false },
153 153
       { "type": "object", "properties": { "musicvideoid": { "$ref": "Library.Id", "required": true } }, "additionalProperties": false },

0 notes on commit 97c236f

Please sign in to comment.
Something went wrong with that request. Please try again.