JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC

  Thread Rating:
  • 8 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2041
Yeah it should absolutely be the total number of library items otherwise we could just drop the value completely.

I don't use partymode either but joethefox, the author of the (new) official iOS XBMC remote has brought the same issue to my attention as well. I'll have to think on it because the general playlist support is still very immature (because it is very immature in XBMC itself).

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
N3MIS15 Offline
Donor
Posts: 504
Joined: Jul 2010
Reputation: 13
Location: Melbourne, VIC
Post: #2042
Is there a way to have Playlist.Add queue folders recursively? It seems to fail if the given folder does not contain media files..
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2043
No there's currently no way to make it go through the folders recursively.

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
Millencolin007 Offline
Fan
Posts: 408
Joined: Mar 2012
Reputation: 9
Location: Switzerland
Post: #2044
Using the following command to retrieve all songs from xbmc I get invalid track numbers for some mp3 files. The problem seems to occur every time the "disc number" is set in the id3 tag. Other thing I spotted is that the rating is displayed as ascii value instead of an int.

Is there a way to retrieve the correct track number from the value (65540 instead of 4) that is returned from xbmc since I would like to make it work with xbmc eden?

Code:
curl  -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"AudioLibrary.GetSongs\", \"params\" : { \"properties\" : [\"title\", \"artist\", \"genre\", \"album\", \"track\", \"thumbnail\", \"file\", \"duration\", \"rating\"] }, \"id\" : 1 }"  http://10.0.0.136:8080/jsonrpc | python -mjson.tool

Code:
{
    "album": "Write About Love",
    "artist": "Belle and Sebastian",
    "duration": 273,
    "file": "/home/xbmc/Music/new/Belle and Sebastian - I Want the World to Stop.mp3",
    "genre": "Indie",
    "label": "I Want the World to Stop",
    "rating": 48,
    "songid": 18,
    "thumbnail": "special://masterprofile/Thumbnails/Music/2/22e91d13.tbn",
    "title": "I Want the World to Stop",
    "track": 65540
},


EDIT: looks actually that I can retrieve the track number by using "track modulo 65536" and "track / 65536" to retrieve the disc number
(This post was last modified: 2012-06-29 09:11 by Millencolin007.)
find quote
rogerthis Offline
Donor
Posts: 218
Joined: Apr 2011
Reputation: 2
Location: Connacht
Post: #2045
Montellese You have a pull request: https://github.com/xbmc/xbmc/pull/821 for "JSON-RPC: Addons namespace with GetAddons, GetAddonDetails, SetAddonEnabled and ExecuteAddon"

Is this the pull request that will enable the VFS browsing for addons, so you can start and play contents from a web interface?

Is this close to getting accepted?
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2046
(2012-06-29 15:47)rogerthis Wrote:  Montellese You have a pull request: https://github.com/xbmc/xbmc/pull/821 for "JSON-RPC: Addons namespace with GetAddons, GetAddonDetails, SetAddonEnabled and ExecuteAddon"

Is this the pull request that will enable the VFS browsing for addons, so you can start and play contents from a web interface?
IIRC spiff is/was working on integrating addons into the VFS. My PR provides methods to retrieve all installed addons and their details and a method to call/execute them but you'll need to know the expected parameters for it to work.

(2012-06-29 15:47)rogerthis Wrote:  Is this close to getting accepted?
Unfortunately I haven't really gotten any feedback (apart from a review from jmarshall) on the PR although I brought it up a few times.

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
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2047
(2012-06-28 23:57)Millencolin007 Wrote:  Using the following command to retrieve all songs from xbmc I get invalid track numbers for some mp3 files. The problem seems to occur every time the "disc number" is set in the id3 tag. Other thing I spotted is that the rating is displayed as ascii value instead of an int.

Is there a way to retrieve the correct track number from the value (65540 instead of 4) that is returned from xbmc since I would like to make it work with xbmc eden?

Code:
curl  -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"AudioLibrary.GetSongs\", \"params\" : { \"properties\" : [\"title\", \"artist\", \"genre\", \"album\", \"track\", \"thumbnail\", \"file\", \"duration\", \"rating\"] }, \"id\" : 1 }"  http://10.0.0.136:8080/jsonrpc | python -mjson.tool

Code:
{
    "album": "Write About Love",
    "artist": "Belle and Sebastian",
    "duration": 273,
    "file": "/home/xbmc/Music/new/Belle and Sebastian - I Want the World to Stop.mp3",
    "genre": "Indie",
    "label": "I Want the World to Stop",
    "rating": 48,
    "songid": 18,
    "thumbnail": "special://masterprofile/Thumbnails/Music/2/22e91d13.tbn",
    "title": "I Want the World to Stop",
    "track": 65540
},


EDIT: looks actually that I can retrieve the track number by using "track modulo 65536" and "track / 65536" to retrieve the disc number

I didn't know about that behaviour of "track" because I never used discnumbers. I'll see if I can fix it up. Same for the rating.

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
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2048
Fixed the "rating" output of songs/albums and made the "track" property only output the actual track number. The new "disc" property will contain the disc number and can also be set through AudioLibrary.SetSongDetails. See https://github.com/xbmc/xbmc/compare/025...3cc8ed5ac7

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
Mizaki Offline
Fan
Posts: 726
Joined: Apr 2011
Reputation: 14
Post: #2049
So was I wrong in blaming the scrapper http://forum.xbmc.org/showthread.php?tid=121954 ?

[Image: watched-clearlogo.jpg]
AWXi - Ajax web interface. Wiki
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2050
(2012-06-29 21:27)Mizaki Wrote:  So was I wrong in blaming the scrapper http://forum.xbmc.org/showthread.php?tid=121954 ?

Yup seems like it Wink

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
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2051
Sunday, July 1st 2012:
Commit: 64aea4d83de8899e2449
  • added "fanart" and "thumbnail" parameters to VideoLibrary.SetFooDetails

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
Mizaki Offline
Fan
Posts: 726
Joined: Apr 2011
Reputation: 14
Post: #2052
I don't know if the additional changes you made to the limited sorting after the accidental commit has made the difference but, using the same limited (50 movies a time) request between Eden and Frodo, it takes about twice as long. I'm sure when I tried it the previous time it was much quicker than Eden. Hopefully someone else can confirm that Eden is quicker with limits than Frodo?

I do only have 650 odd movies so maybe someone with a large library will see the benefit more.

[Image: watched-clearlogo.jpg]
AWXi - Ajax web interface. Wiki
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2053
Are you running OSX by chance? For whatever reasons all requests like VideoLibrary.GetFoo take longer on OSX in pre-Frodo. On win32 and linux it's fine.
As the new merge window opened today I pulled my PR into master which will use the new sorting/limiting functionality for JSON-RPC and this time for real Wink It should be in tomorrows nightly build.

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
Mizaki Offline
Fan
Posts: 726
Joined: Apr 2011
Reputation: 14
Post: #2054
Using Linux and just pulled and built Smile

Example:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "limits": { "start" : 200, "end": 250 }, "properties" : ["rating", "thumbnail", "playcount", "file"], "sort": { "order": "ascending", "method": "label", "ignorearticle": true } }, "id": 1}
Takes on average 200ms with Eden and 700ms with git. I took the rough average with 5 requests.

And for some reason:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "limits": { "start" : 350, "end": 400 }, "properties" : ["rating", "thumbnail", "playcount", "file"], "sort": { "order": "ascending", "method": "label", "ignorearticle": true } }, "id": 1}
gives me a segfault.

[Image: watched-clearlogo.jpg]
AWXi - Ajax web interface. Wiki
(This post was last modified: 2012-07-01 19:24 by Mizaki.)
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,847
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #2055
On my win32 machine (i7) that exact request takes around 65-70 ms with current master, around 280-300 ms with the nightly build from June 26th and around 120-140 ms with Eden. If I run it in debug mode it takes around 250-300ms. The very first JSON-RPC request is always slow(er) because the webserver only starts setting up the simultaneous threading stuff when the first HTTP request arrives.

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
Post Reply