Kodi Community Forum

Full Version: Paths needing to be added as a source before JSON-RPC can access them.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just noticed that a path needs to be added as a source in XBMC's File Manager before JSON-RPC can access it. Is this by design or a bug? Add ons have access to these with out adding as sources

For example:

Fresh Install. All that shows up in File Manager is my Optical Drive.

If I issue the following command
Code:
{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "T:\\Trailers\\", "media": "video"}, "id": 1}
I get the following error.
Code:
{"error":{"code":-32602,"message":"Invalid params."},"id":1,"jsonrpc":"2.0"}

If I add the mapped drive 'T:\" as a source, the same query gives the proper result(it also happens on local drives as well)
Code:
{"id":1,"jsonrpc":"2.0","result":{"files":[{"file":"T:\\Trailers\\2013-02-04 The Lords of Salem  (Trailer)\\","filetype":"directory","label":"2013-02-04 The Lords of Salem  (Trailer)","type":"unknown"},{"file":"T:\\Trailers\\2013-02-04 Like Someone in Love  (Trailer)\\","filetype":"directory","label":"2013-02-04 Like Someone in Love  (Trailer)","type":"unknown"}],"limits":{"end":2,"start":0,"total":2}}}

If this is a bug, I'll post a Trac ticket. If it's by design, I'll just keep informing users of my add on to add their paths as sources.
by design as some security measure addons/client can't access your whole drive without you giving permission for it.
I just fell upon the Team discussion after I posted here. I remember when it was necessary to add the path(s) as a source for addon settings(which no longer seems to be the case).
I'm running into what may be a related issue. I add an SMB music source in the sources.xml file. Reboot xbmc and I see the source listed. At this point, I'd like to force a scan of my music library with JSON-RPC but it doesn't scan my new source.

I'm looking for an automated way to add a long list of Music sources.