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
topfs2 Offline
Team-XBMC Developer
Posts: 3,825
Joined: Dec 2007
Reputation: 8
Post: #321
ncarthy Wrote: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;
}

Definatly put it on trac but I think the best way is to make it go through the entire HandleFilelist method which would allow sort, start and end.

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
MKay Offline
Member
Posts: 81
Joined: Jan 2010
Reputation: 10
Post: #322
Hi,

i like the new api, but i have some annotations:

1. Playlist.Remove does not work (The other people already mentioned that. Rolleyes ). It would be nice if this would be implemented.

2. GetShares / GetRootDirectory does not work.

3. It's possible to add a folder to the playlist:
Code:
'{"method": "AudioPlaylist.Add", "params": { "file": "/media/usb/mp3" }}'
But the API will not add the files (inside the folder) itself to the playlist.

4. I use the following code to add a file to the playlist:
Code:
'{"method": "AudioPlaylist.Add", "params": { "file": "/media/usb/mp3/track.mp3" }, "id": 1}'
This works fine, but then AudioPlaylist.GetItems returns no song-information like artist, label etc. with this command:
Code:
'{"method": "AudioPlaylist.GetItems", "params": { "fields": ["title", "album", "artist", "duration"] }}'
The response is:
Code:
id: 1
jsonrpc: 2.0
result:
     current: 0
     end: 1
     items:
          0:
               fanart: special://masterprofile/Thumbnails/Video/Fanart/f58940e3.tbn
               file: /media/usb/mp3/Track.mp3
               label:
     paused: false
     playing: true
     start: 0
     total: 1
It would be nice, if this can be fixed. Laugh

5. A method to toggle shuffle-mode would be nice Big Grin

6. The GetXYZInfo-methods are not implemented yet.

Greets,
MKay
(This post was last modified: 2010-09-18 21:59 by MKay.)
find quote
ncarthy Offline
Junior Member
Posts: 24
Joined: Aug 2010
Reputation: 0
Post: #323
Hi,

I can't answer for items 1-3 on your list but with item 4 I know you won't see any information unless that file is in the music or video database. So just add it and re-run your query.
find quote
MKay Offline
Member
Posts: 81
Joined: Jan 2010
Reputation: 10
Post: #324
Yes that's right, but i want to play for example music from an usb-stick without adding the files to the database ;-)
The old HTTP API had a method for this: AddToPlayList(...).
find quote
ncarthy Offline
Junior Member
Posts: 24
Joined: Aug 2010
Reputation: 0
Post: #325
hmm, I see now.:o I've looked at the http api method but it doesn't seem to do any extra processing of metadata.

Have you tried using Playlist.Add instead of AudioPlaylist.Add?
find quote
MKay Offline
Member
Posts: 81
Joined: Jan 2010
Reputation: 10
Post: #326
Playlist.Add returns an error :-)
AudioPlaylist.Add works, but with the problem that no information (Artist, Title etc.) about the files is returned when using AudioPlaylist.GetItems.
find quote
alex84 Offline
Senior Member
Posts: 177
Joined: Jan 2010
Reputation: 2
Location: Sweden
Post: #327
Hi i recently updated to dharma. On camelot i was running an python script from my nas when an movie was finished to issue an update library.

Update.py
Code:
#!/usr/bin/python
import urllib
urllib.urlopen("http://user:pass@192.168.1.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)").close()

This updated my library. I wonder if i would be able to achive the same thing with the new json?

Best regards

---------------------------------------------------
ASRock 330HT Running XBMC 11 | ATV2 | Logitech Harmony One | Onkyo TX-NR808 Receiver | QNAP 809 | APC Back-UPS RS 550
find quote
rkpat_dallas Offline
Junior Member
Posts: 5
Joined: Sep 2010
Reputation: 0
Post: #328
Hi, I'm very new to XBMC, and i really need some help. I am trying to use XBMC to play videos on a PC, but I want to control the playlist from another PC. i assume i need to use JSON-RPC to initiate the playlist and play/pause/stop etc.

I am completely clueless how to get started. can some one help me get started? i am proficient w/ .NET and plan to use it. but have no idea where to start. Please help...
find quote
topfs2 Offline
Team-XBMC Developer
Posts: 3,825
Joined: Dec 2007
Reputation: 8
Post: #329
you can use xbmc-send or the webinterface if you don't want to program it

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
Therms Offline
Senior Member
Posts: 120
Joined: Dec 2008
Reputation: 0
Post: #330
Feature request.

I'm not sure if this is even possible, but I'd be in heaven if I could add and remove single tv shows and movies from the library via JSON-RPC instead of doing a blanket VideoLibrary.ScanForContent
(This post was last modified: 2010-09-26 23:36 by Therms.)
find quote
Post Reply