![]() |
|
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- XBMC Community Forum (http://forum.xbmc.org) +-- Forum: Development (/forumdisplay.php?fid=32) +--- Forum: Development (/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (/forumdisplay.php?fid=174) +---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263) Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
- Ilia - 2010-10-15 04:06 topfs2 Wrote:It has been changed, its sort: { "method": "rating", "order": "ascending" } Thanks for the reply, but I am still not getting the right result curl -i -X POST -d '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies","params":{"fields":["rating"],"method":"rating","order":"ascending"}, "id": 1}' http://localhost:8080/jsonrpc It still sorts then by movieid - Ilia - 2010-10-15 04:09 hello_man Wrote:Topfs2, is there any documenation or some way to know all the apis exposed and their respective parameters and return value? There is a wiki page at http://wiki.xbmc.org/index.php?title=JSON_RPC, but it seems to be out of date and incomplete
- dstruktiv - 2010-10-15 05:05 JSONRPC.Introspect and digging through the c++ jsonrpc code in the xbmc svn (Everything's easy to read even if c++ is new to you). JSON-RPC interface is still in beta and under heavy development I don't think it's fair to expect all documentation to be 100% accurate and up to date. - barrygordon - 2010-10-15 07:06 Thanks for the simplification. It will make things simpler and a trivial change since most of the code I wrote is table driven for flexibility!! - Ilia - 2010-10-15 07:14 Found it, by digging though cpp, if anyone is intrested: "sort":{"method":"videorating","order":"descending"} <- make sure u have no spaces between the "" other methods: date, size, file, drivetype, track, duration, title, artists, album, genre, year, videorating, programcount, playlist, episode, title (video), sorttitle (without "the") productioncode, songrating, mpaarating, videoruntime, studio, fullpath, lastplayer, unsorted, max all available to see in xbmc/lib/libjsonrpc/FileItemHandler.cpp - Montellese - 2010-10-15 12:32 Hey guys As Soundgraph has released a first API to access their LCDs and VFDs from 3rd party applications I started writing a tool (with C#) which uses the JSON-RPC service XBMC provides with Dharma to display information about currently playing items on the LCD/VFD. I found the xbmc-json library developped by dstruktiv and think it's quite useful. But I am lacking the possibility of receiving announcements (I absolutely don't want to poll the status of the players every second or so). Could someone please provide me some detailed information on how to catch those announcements? As far as I found out these are broadcasted over TCP on port 9090. Is that correct and is that port fixed or do I need to configure it somewhere? - topfs2 - 2010-10-15 15:31 Montellese Wrote:Could someone please provide me some detailed information on how to catch those announcements? As far as I found out these are broadcasted over TCP on port 9090. Is that correct and is that port fixed or do I need to configure it somewhere? Just open a TCP socket to 9090 and there you have it. By default you are listening to all announcements but for future reference you can use the SetAnnouncementFlags to tell which you actually are interested in. To test just use putty against 9090 and you'll get the data. No way to configure, always 9090. It should be announced over zeroconf which is a good way to handle if it ever changes. - Montellese - 2010-10-15 15:46 topfs2 Wrote:Just open a TCP socket to 9090 and there you have it. By default you are listening to all announcements but for future reference you can use the SetAnnouncementFlags to tell which you actually are interested in. Thanks. Just wanted to confirm the details on the port and the protocol as it is not available in the wiki article. Maybe I'll try to extend the xmbc-json plugin to throw an event when something comes in. - MKay - 2010-10-15 18:08 topfs2 Wrote:Hmm, I didn't think of your scenario MKay.[...](topfs2 asked me to post my PM here for discussion about solutions ![]() To get the currently playing data (e.g. artist and title of a song) i need to get the active player (GetActivePlayers) and then get the playlist's items with GetItems. The result contains a field with the name "current" which is the playlist-entry-index of the currently playing file, right? So when i want to get the artist/title of the currently playing song i can retrieve the playlist's data with GetItems and everything is fine. But when a song is playing (playlist has one entry) and i clear the playlist with AudioPlaylist.Clear then there is no way to get the artist/title of the currently playing file because the GetItems-function of the playlist will return an empty list (as i know). At least this was the case in beta2 ... beta3 not tested yet
- Tolriq - 2010-10-15 22:57 After some tests i can confirm that System.GetInfoLabels is good for getting currently informations even with empty playlist ![]() Even permit to send one less request for getting the seekposition ![]() See http://wiki.xbmc.org/?title=InfoLabels for list ![]() Just a little question not json related but since it have the same effect perhaps topfs have a solution ![]() The info label : System.KernelVersion always send busy on the first request need to wait for 300 or 400 ms to retry and get the data (same with httpapi) Not very important but since i use this to check if Yatse connects to the correct machine it's annoying to add delays for nothing
|