Kodi Community Forum

Full Version: Discussion over Files.* method
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I have been looking around the forum for a way to use the Files.* methods in the JSON-RPC over websockets.

I managed to browse the sources and directories. But I cannot seem to be able to do anything when I get to files.

Files.GetFileDetails, Files.Download or Files.PrepareDownload don't do anything.

I would like to be able to play the videos / music and display the pictures but I cannot even get an URL for it.

Am I missing something there?

Thanks for your help....
Files.GetDirectory should already provide you with a path of the file. You can just use that in Player.Open if you want to play a file in XBMC.
Files.Download is currently not implemented and Files.PrepareDownload only works over HTTP because we only support accessing/downloading files from XBMC through HTTP right now.
Thanks for the reply. I figured out the Player.Open.

I will try the Files.Download method for the other files (no music, no video, no pictures).

Thanks a lot
Uhm I just told you that Files.Download doesn't work at all. You don't need to try it, it will simply fail. When you use HTTP you can use Files.PrepareDownload to pass in a path to a file you got through Files.GetDirectory (or some other JSON-RPC method) and then you get back the path you need to call on XBMC's webserver to be able to download that file.
I am getting thumbnail field blank for file type items, where as XBMC shows thumbnail while browsing through Video->Library->Files. I am not sure is expected or need to follow some other procedure to get thumb images urls.

sample query:
{\"jsonrpc\": \"2.0\", \"method\": \"Files.GetDirectory\", \"params\": { \"limits\": { \"start\": 0, \"end\": 0 }, \"properties\": [\"title\", \"file\", \"thumbnail\", \"fanart\"], \"directory\": \"<DIRECTORY>\", \"media\": \"video\"}, \"id\": 1}

Even Files.GetDetails for the file item behaves same for thumb nail.
Try getting the "art" property. I think there is some special handling for it to load artwork if it hasn't already been loaded. This special handling might be missing for "thumbnail" and "fanart" (which are superseeded by "art" anyway.
2 different bugs Smile

First you cannot from JSON make XBMC generate the thumbs for files you have to display the folder from the GUI for that Sad

Second the thumbnails are not accessible either with art or anything, you need to generate hacks based on media type (music / video / pictures) to get access to the texture cache.

One day perhaps it will work in the API Wink