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

  Thread Rating:
  • 7 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Malard Offline
Team-XBMC Developer
Posts: 400
Joined: Jul 2010
Reputation: 16
Location: Peterborough, UK
Post: #311
jonib Wrote:Thanks for the reply.
Instead of Dharma Beta1? If so where to get binary? and I assume JSON-RPC support is better or why the webinterface branch?So I need to add the file to the library first? I don't see a command for that. And I can't assume the file is already in the library.

jonib

There is no pre-compiled binary for the webinterface branch, you will need to compile this manually for the time being.

Raise a trac ticket for exactly what you are trying to do, I will either provide a sample fragment of code on how to do what your wanting correctly, implement the feature you require, or explain why what you are trying to do wont be supported.

Thanks
find quote
jonib Offline
Junior Member
Posts: 45
Joined: Mar 2006
Reputation: 0
Post: #312
Malard Wrote:There is no pre-compiled binary for the webinterface branch, you will need to compile this manually for the time being.
I assumed as much, so it wont help me until there is.
Quote:Raise a trac ticket for exactly what you are trying to do,
Hmm, I'm not sure a trac ticket is appropriate place to declare my desire to learn how to use the JSON-RPC API in XBMC Big Grin
Quote:I will either provide a sample fragment of code on how to do what your wanting correctly, implement the feature you require, or explain why what you are trying to do wont be supported.
I thought my post was clear of what I wanted, I guess not. Confused

I'm just trying to add a video file to the current playlist in XBMC via the VideoPlaylist.Add command, but the added entry doesn't get any label/title/text just an empty line.

I don't want any new functionality, I just want to know why my code doesn't work, if it's a bug in the command or the feature is not implemented or that I'm using the wrong syntax.

[Image: XBMCJSON.PNG]
There are two videos in this list, the second added with VideoPlaylist.Add command from my other post, both work to play the video. There just is no label.

jonib

XBMC2, EventGhost plugin. [Image: flattr-badge-large.png]
find quote
Malard Offline
Team-XBMC Developer
Posts: 400
Joined: Jul 2010
Reputation: 16
Location: Peterborough, UK
Post: #313
jonib Wrote:I assumed as much, so it wont help me until there is.
Hmm, I'm not sure a trac ticket is appropriate place to declare my desire to learn how to use the JSON-RPC API in XBMC Big Grin
I thought my post was clear of what I wanted, I guess not. Confused

I'm just trying to add a video file to the current playlist in XBMC via the VideoPlaylist.Add command, but the added entry doesn't get any label/title/text just an empty line.

I don't want any new functionality, I just want to know why my code doesn't work, if it's a bug in the command or the feature is not implemented or that I'm using the wrong syntax.

[Image: XBMCJSON.PNG]
There are two videos in this list, the second added with VideoPlaylist.Add command from my other post, both work to play the video. There just is no label.

jonib


Thanks, probably me being a bit dumb in not translating your post; I will look into this probably sooner rather than later as I am writing the video management section of the web interface (basics of audio is now sorted)

This is most likely a bug, infact an empty label in a playlist item is something we dont want in the GUI anyway, it should read '<no label>' at the very least so the user is aware something is there.

Raise a trac ticket for that.
find quote
jonib Offline
Junior Member
Posts: 45
Joined: Mar 2006
Reputation: 0
Post: #314
Malard Wrote:Raise a trac ticket for that.
I have made a ticket here. Hopefully I added all relevant info.

jonib

XBMC2, EventGhost plugin. [Image: flattr-badge-large.png]
find quote
ncarthy Offline
Junior Member
Posts: 24
Joined: Aug 2010
Reputation: 0
Post: #315
Does anyone know how you play all the songs on an album in order of tracknumber?

I can add the album to an AudioPlaylist and then play it with the commands below but it only sorts the songs in order of title A-Z.

Code:
{"id":1,"jsonrpc":"2.0","method":"AudioPlaylist.Add","params":{"albumid":96}}

{"id":2,"jsonrpc":"2.0","method":"Audioplaylist.Play"}

Adding Sort parameters to the Playlist.Add seems to have no effect.

Do I just have to retrieve all the songs and then manually add them to the playlist in my desired order?
I can retrieve an album's songs in tracknumber order with:

Code:
{"id":3,"jsonrpc":"2.0","method":"AudioLibrary.GetSongs",
            "params":{"albumid":96, "sort":{"method":"track"}}}
(This post was last modified: 2010-09-12 01:23 by ncarthy.)
find quote
topfs2 Offline
Team-XBMC Developer
Posts: 3,825
Joined: Dec 2007
Reputation: 8
Post: #316
The idea is that you should be able to use sort and such aswell on add but looking at the code that test case have been overlooked and I guess it will need to wait until eden. But still, the add of an albumid should make it track wise afaik.

But otherwise your on your own for that and need to do get items and manually add each songid. A sturdier way is to add it to a virtual playlist and then start or add that virtual playlist to the currently playing one.

I'll see if I can cook up a patch for it unless someone beats me to it.

Something that should work is AudioPlaylist.Add", { "artistid": x, "sort": "track", "start": 3, "end": 15 }

If you have problems please read this before posting

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]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
ncarthy Offline
Junior Member
Posts: 24
Joined: Aug 2010
Reputation: 0
Post: #317
Thanks for taking a look at it. Is this the kind of thing that should be put on Trac?

I'm pretty sure no sorting is applied so that the order that the tracks are seen is solely determined by the order the results are returned from the sql dB.
find quote
ncarthy Offline
Junior Member
Posts: 24
Joined: Aug 2010
Reputation: 0
Post: #318
I reckon all that is required is something like:

Code:
Index: FileItemHandler.cpp
===================================================================
--- FileItemHandler.cpp    (revision 33661)
+++ FileItemHandler.cpp    (working copy)
@@ -225,6 +225,8 @@
   CVideoLibrary::FillFileItemList(param, list);
   CFileOperations::FillFileItemList(param, list);

+  Sort(list, param);
+
   return true;
}
find quote
brunick Offline
Junior Member
Posts: 1
Joined: Sep 2010
Reputation: 0
Post: #319
hey, i've followed this thread a while, but i've not come across a solution to the navigation problem. is it possible in the final dharma that you can send keyboard keys or like "up" "back" or "menu" with the json rpc?

oh and i think i found a bug:
when you try to play a file which has moved the whole system stops until you've clicked the "missing file" dialog on the server
find quote
ncarthy Offline
Junior Member
Posts: 24
Joined: Aug 2010
Reputation: 0
Post: #320
You can always use the eventserver api for these kind of commands. It's UDP based so minimal overhead, very fast.

There are example clients here: http://xbmc.svn.sourceforge.net/viewvc/x...ntClients/
find quote
Post Reply