Hi,
I am trying to use JSON RPC API talking to my XBMC v10.0 running on MacOS X. I tried the following calls but got result "null":
telnet localhost 9090
{"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists", "params": {"fields": ["artistid", "label"]}, "id": 1}
{
"id" : 1,
"jsonrpc" : "2.0",
"result" : null
}
{"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists","params":{}, "id":3}
{
"id" : 3,
"jsonrpc" : "2.0",
"result" : null
}
{"jsonrpc": "2.0", "method": "AudioLibrary.GetSongs", "id": 1}
{
"id" : 1,
"jsonrpc" : "2.0",
"result" : null
}
But I can play songs in XBMC and I can see the Announcements via JSON-RPC:
{
"jsonrpc" : "2.0",
"method" : "Announcement",
"params" : {
"message" : "QueueNextItem",
"sender" : "xbmc"
}
}
I cannot find why I was not able to get results querying about Artists. Any help is appreciated.
Thanks.
result is null from JSON RPC API
keepsimple
Junior Member Posts: 7 Joined: Aug 2011 Reputation: 0 |
2011-09-06 01:23
Post: #1
|
| find quote |
giftie
Skilled Python Coder Posts: 2,037 Joined: Mar 2010 Reputation: 35 |
2011-09-06 02:05
Post: #2
keepsimple Wrote:Hi,Check the output of JSONRPC.Introspect for the valid fields. If you drop the 'params":{} all together, you will get the output your looking for(artistid and label) Quote:{"jsonrpc": "2.0", "method": "AudioLibrary.GetSongs", "id": 1} AudioLibrary.GetSongs needs params... ![]() For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script. Cinema Experience Cinema Experience Wiki cdART Manager fanart.tv |
| find quote |
keepsimple
Junior Member Posts: 7 Joined: Aug 2011 Reputation: 0 |
2011-09-06 07:34
Post: #3
giftie Wrote:Check the output of JSONRPC.Introspect for the valid fields. If you drop the 'params":{} all together, you will get the output your looking for(artistid and label) I tried to drop the "params":{} , but still get result "null": {"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists", "id": 2} { "id" : 2, "jsonrpc" : "2.0", "result" : null } |
| find quote |
dann0
Junior Member Posts: 29 Joined: Jan 2011 Reputation: 0 |
2011-09-06 08:09
Post: #4
first question would have to be have you scanned media in to your library?
what you describe is exactly the response i get before adding a source to my library and scanning it. |
| find quote |
keepsimple
Junior Member Posts: 7 Joined: Aug 2011 Reputation: 0 |
2011-09-06 08:28
Post: #5
dann0 Wrote:first question would have to be have you scanned media in to your library? I did scan the library and I can play the songs in XBMC. Still cannot get results: {"jsonrpc": "2.0", "method": "AudioLibrary.ScanForContent", "id": 1} { "id" : 1, "jsonrpc" : "2.0", "result" : "OK" } {"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params": {"fields": ["album_title"]}, "id": 1} { "id" : 1, "jsonrpc" : "2.0", "result" : null } {"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists", "id": 1} { "id" : 1, "jsonrpc" : "2.0", "result" : null } |
| find quote |
Montellese
Team-XBMC Developer Joined: Jan 2009 Reputation: 20 Location: Switzerland |
2011-09-06 10:07
Post: #6
keepsimple Wrote:I did scan the library and I can play the songs in XBMC. Still cannot get results: That's not enough to get your albums, artists and songs into your library and you can also play songs in XBMC without adding them to the library. You need to add a music source to your library and tell it where to look for your audio files. If JSONRPC does not return a result you haven't scanned your audio files into your library. 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. ![]() |
| find quote |
keepsimple
Junior Member Posts: 7 Joined: Aug 2011 Reputation: 0 |
2011-09-07 07:36
Post: #7
Montellese Wrote:That's not enough to get your albums, artists and songs into your library and you can also play songs in XBMC without adding them to the library. You need to add a music source to your library and tell it where to look for your audio files. Thanks for the assertion :-) Finally I found what it means by "into the library". It had to right click on the music item and select "Scan item to library". I am sorry that I am asking some very basic questions. However, is this just me? I found this is very confusing. First, I am wondering what is the difference between "Add source" and "Scan to library"? Second, where can I look at my music library? It's clear that all sources are listed. But where is the "library"? In any case, Thanks again for your help. Now my JSON-RPC is working :-) |
| find quote |
keepsimple
Junior Member Posts: 7 Joined: Aug 2011 Reputation: 0 |
2011-09-07 07:44
Post: #8
Just a follow-up, I found that I have to enable "Library mode" from a "hidden" left-bar menu to be able to see the music library. I thought it could be more straight forward...
|
| find quote |

![[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]](http://www.mediafire.com/conv/e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e4d2fe70f903275f93e5e4c076g.jpg)
![[Image: badge.gif]](http://www.ohloh.net/projects/9132/badge.gif)
Search
Help