Files.GetDirectory

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
regieg Offline
Junior Member
Posts: 3
Joined: Mar 2012
Reputation: 0
Post: #1
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
(This post was last modified: 2012-03-04 22:11 by regieg.)
find quote
Montellese Online
Team-XBMC Developer
Posts: 2,790
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #2
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.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
regieg Offline
Junior Member
Posts: 3
Joined: Mar 2012
Reputation: 0
Post: #3
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!
find quote