JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/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
|
- Montellese - 2012-02-22 Mizaki Wrote:On a similar note and probably another silly question by me but how can I get the limit of items? Well whenever you call one of the FooLibrary methods JSON-RPC will always run the full query independant of what you have set in the "start" and "end" properties of the "limits" parameter. But if you don't retrieve all the items (by specifying start and end) you will still get the "total" property in the "limits" object of the result which will always tell you the size of all the available items. - Mizaki - 2012-02-22 To re-confirm then. There is no way to mitigate against a large library and slow machine (ATV2 for example)? The problem is, by the sounds of it, I have someone who is timing out on the call before the results can be returned. - Montellese - 2012-02-22 Currently not because no matter what parameters you pass JSON-RPC will always retrieve all the matching items and then do the sorting and after that the limiting. - carmenm - 2012-02-24 carmenm Wrote:That makes sense and might just be it as i know i ask for cast (to create a DB of actors). Will try that tomorrow, and share the result. Ok so i just made the test with my atv2 and you were RIGHT! Without cast: 267 movies -> 3-4sec With cast : 267 movies -> 20-25 sec!!!! Will have to find another way to sync actors/roles Thanks a lot - devastator83 - 2012-02-24 Hi, I love the 'new' JSON API! At the moment I am writing a script for my Philips Pronto remote control. Whenever it 'wakes up' from sleep, I have to do 3 requests: 1) GetActivePlayer: to check if the active player has changed while the remote was sleeping 2) Player.GetProperties (if 1 returned a player): to get the player status 3) Player.GetItem: to check if the played video/song changed. It would be handy if I could do this with 1 or 2 calls only. GetActivePlayer could e.g. return the speed and the library id of the currently played item. I cache the library item id to check if the playback item has changed, in which case I download the new data with Player.GetItem. Or does such a call already exist to fit my needs ? Thanks for your work ! - Montellese - 2012-02-24 No but you can do 2) and 3) in a batch request i.e. send them together in one request and receive the response together as well. You still need to parse and evaluate them seperately but you save some time because you don't have to wait for 2) to finish before sending 3). - devastator83 - 2012-02-24 Thanks for your (very) fast response How do you mean, send them in batch ? How doest that look ? Are they encapsulated ? - Montellese - 2012-02-24 For batch requests see http://jsonrpc.org/spec.html and scroll down to "Batch" and there are also some examples of batch requests at the end of the page. .Net C# Library - mjeanrichard - 2012-02-24 Hi, I am writing an async .Net Library (C#) for the JSON-RPC API. The code is available on Github (https://github.com/mjeanrichard/XBMC-Net-Library) if anybody is interested. Most of the Types are automatically generated from the JSON.Introspect-Schema. Any suggestions / inputs are welcome! Cheers Meinrad - jimk72 - 2012-02-27 I am trying to get the length or "duration" of a movie but the results do not return. I am displaying currently playing items and when a song is selected it displays the duration but not when a movie is played. Is there a different property i should be requesting? {"jsonrpc":"2.0","id":10,"method":"Player.GetItem","params":{"playerid":'+inttostr(GetActivePlayer)+',"properties":["thumbnail","artist","duration","album"]}} results if movie: {"id":10,"jsonrpc":"2.0","result":{"item":{"album":"","artist":"","id":133,"label":"Abduction","thumbnail":"special://masterprofile/Thumbnails/Video/3/3ce2f0b8.tbn","type":"movie"}}} results if song: {"id":10,"jsonrpc":"2.0","result":{"item":{"album":"The Black Parade","artist":"My Chemical Romance","duration":299,"id":1028,"label":"Famous Last Words","thumbnail":"special://masterprofile/Thumbnails/Music/8/8546d948.tbn","type":"song"}}} - Montellese - 2012-02-27 Yes you need to request the "runtime" property for video items. But that property is a string and can contain things like "mins" etc. An alternative is to also retrieve "streamdetails" and look at the video stream. It should contain a seconds-based number for the length of the stream. Can't remember the name off the top of my head so look into introspect, the wiki or the response of your request. - Ep Woody - 2012-02-27 I am trying to build a webinterface for my iPhone which also will be sending out IR commands to my reciever. In the new JSON-RPC Api I can't find anything that will help me with that. Is that correct? Should I use a different technique for that? - Montellese - 2012-02-27 What does XBMC's JSON-RPC have to do with IR commands? I have no clue but I don't know about XBMC's core being able to send IR commands. - Ep Woody - 2012-02-27 I thought the JSON-RPC is the way to go to communicate with XBMC. Since the Wikipage says the HTTPApi is depreciated. However I wasn't able to use JSON-RPC to use one of the Builtin commands, which is quite easy using the HTTPApi. I'm using the HTTPApi now to execute Lirc.Send, which is fine by me. - Montellese - 2012-02-27 Ah right. Yeah the JSON-RPC API will not allow direct access to the Builtin commands. These are generally meant for XBMC internal purposes and for skins. Certain builtin commands are wrapped in JSON-RPC commands (with parameter-checking etc) if necessary. I'm not sure but maybe the EventServer allows access to the builtin methods as well. |