2014-02-07, 15:22
(2014-02-07, 12:10)Tolriq Wrote: Some Files.GetDirectory weirdness
It seems the directory param is somehow case sensitive but not totally.
Let's say you have a source configured as C:\xx
Code:{"jsonrpc":"2.0","id":1,"method":"Files.GetDirectory","params":{"directory":"C:\\xx\\","media":"video","properties":["resume"]}}
Will return the correct resume value for the media
but
Code:{"jsonrpc":"2.0","id":1,"method":"Files.GetDirectory","params":{"directory":"c:\\xx\\","media":"video","properties":["resume"]}}
Will return 0 as resume and empty other fields.
(And in the listing all media have a c:\xx\... path)
This should either work in both case, or gives an error when using the wrong case but right now it's quite disturbing and may make some devs loosing hairs and time
And another detail (or not) :
Code:{"jsonrpc":"2.0","id":1,"method":"Files.GetDirectory","params":{"directory":"c:\\xx\\","properties":["resume"]}}
Same query without specifying a media type will not return the resume property at all while it should return an empty / 0 one.
Since we should be able to assume that when we request a field and the query is successful the answer should have all the requested fields.
I'll have to look into the virtual filesystem code of XBMC as JSON-RPC simply passes the directory on to that. Maybe there is some path comparison in the JSON-RPC code though. My guess is that there is a path/file based database query which is always case sensitive and will therefore most likely fail and then you don't get any details from the database.
Concerning the missing "resume" property: What happens if you e.g. specify media as "videos" and ask fro the "mood" property (which only exists for albums/songs)? The problem right now is probably that when not specifying any media type (which defaults to "files") it completely bypasses the logic to handle requested properties except for a select few which make sense for files. That way the request can be handled faster.