Kodi Community Forum

Full Version: Files.GetDirectory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all..

Im currently developing a xbmc remote control app for android 4 devices using json rpc for communication See on github.com

In addition to Library management, i also provide a file browser to browse all available media items.
I'm retrieving the files using the Files.GetDirectory command.
But i need additional information like artistid, albumid and songid for further processing.

For example, first i load my files using following json command:
Code:
{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": { "directory": "/media/Music/Alice in Chains/Facelift" }, "id": 1}

This returns all files specified in the given directory (/media/Music/Alice in Chains/Facelift), which is correct.

But now, i want to select a file and adding it to the current playlist. For this purpose, i need albumid, songid and artistid.

How can i retrieve this additional information when loading files using Files.GetDirectory ?

Thanks in advance!

cheers
You don't need the artistid, albumid or any other id. You can use the "file" property of the "item" parameter of Playlist.Add or Player.Open. But if you want to get extra information on those files nonetheless you need to first specify what kind of media ("files" is default, "video", "music") you are looking for using the "media" parameter. That will return an "id" and a "type" property if the file is associated with a media item in XBMC's database. Furthermore you can use the "properties" parameter to specify additional properties you would like to retrieve.
Hi Montellese

Thanks for your response.
That was exactly what i was looking for, it works perfectly :-)

Now im using following json command to play a file
Code:
{"jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "/media/Music/Alice in Chains/Facelift/01 - We Die Young.mp3" } }, "id": 1}"

Thank you!