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
|
- billylg - 2011-06-08 Montellese Wrote:"Parse error" indicates, that the json object of your request is not valid. A good place to check your syntax is http://www.jsonlint.com Using the double slash still wouldn't play the audio file, and the syntax check out fine on http://www.jsonlint.com. But as another user has suggested I was able to play the file by adding to AudioPlaylist then play from the AudioPlaylist. Thanks for all the helps guys! - othrayte - 2011-06-08 Inside the TraktUtilities add-on I had relied on the fact that XBMC's json notifications were separated by '/n' characters but recently these have been removed, was this by design or was it an accident, without these '/n' characters it is much harder to receive the notifications. - Montellese - 2011-06-08 othrayte Wrote:Inside the TraktUtilities add-on I had relied on the fact that XBMC's json notifications were separated by '/n' characters but recently these have been removed, was this by design or was it an accident, without these '/n' characters it is much harder to receive the notifications. This has probably changed with the migration from jsoncpp to yajl and therefore the change of JSON writers. What you should do anyway is counting { and }. So a { increases the counter and a } decreases it and everytime you just read a } and the counter is 0 you received a full object which you can parse. - othrayte - 2011-06-08 Montellese Wrote:This has probably changed with the migration from jsoncpp to yajl and therefore the change of JSON writers. What you should do anyway is counting { and }. So a { increases the counter and a } decreases it and everytime you just read a } and the counter is 0 you received a full object which you can parse. Ok, I had considered this, I wasn't sure whether the {} could exist within "" , or if it was possible to escape the {} characters; because if so then I would also have to check for those. - topfs2 - 2011-06-08 othrayte Wrote:Ok, I had considered this, I wasn't sure whether the {} could exist within "" , or if it was possible to escape the {} characters; because if so then I would also have to check for those. that can happen in theory, so you need to account for that. Most streaming json parsers handles this though - topfs2 - 2011-06-08 Forgot to say that we could add \n between notifications if we wanted, afaik its not outside the spec. Anything in between the json objects is meant to be thrown away if we have proper parsers. I do think its better if we don't have anything in between though, as it makes writing parsers easier IMO (don't have to think about throwing away the wrong data). And checking for \n is not that safe at any rate as you could have \n in a string also (very unlikely though). - prono - 2011-06-08 I use one of the latest builds (PRE-11.0 Git:201105250d1265ed)of XBMC and I'm seeing something that I would expect to be different. 1) If XBMC goes into screen saver mode it stays like that while I send 'Input.Select', 'Input.Up', 'Input.Down', ''Input.Left', 'Input.Right', same for others, most of them, I don't know of any that would cancel the XBMC screensaver. 2) If I send 'XBMC.SetVolume' the volume bar with the new volume setting does not apread. If I send 'XBMC.ToggleMute' the volume bar and the mute sign does apear. 3) Is the behavior described in the below messages as exected? the messages are sent in the same order. {"method":"XBMC.SetVolume","id":101,"jsonrpc":"2.0","params":{"value":0}} {"id":101,"jsonrpc":"2.0","result":0} {"jsonrpc":"2.0","method":"XBMC.ToggleMute","id":100} {"id":100,"jsonrpc":"2.0","result":100} Thank you, - topfs2 - 2011-06-08 volume = 0 is considered mute IIRC, this however is not really sane for json-rpc so I would suggest creating a bugreport. All of the others seems like valid bugs, input should most likely cancel screensave but not execute the action. - Montellese - 2011-06-08 As an FYI the "tvshowid" parameter in VideoLibrary.GetEpisodes just became optional with the latest commit. Now you can retrieve all episodes in your library if needed. But beware if you want to use the "season" parameter, you need to define the "tvshowid" parameter as well. - Montellese - 2011-06-08 And another FYI: There are two new methods available: - AudioLibrary.GetArtistDetails - VideoLibrary.GetGenres (thanks to slash2009) Furthermore we have refactored and renamed the notifications so make sure you check out the new json schema descriptions available from JSONRPC.Introspect in the "notifications" object. Or take a look at the changes in 28743c1647d6cdef84fe. - othrayte - 2011-06-09 topfs2 Wrote:Forgot to say that we could add \n between notifications if we wanted, afaik its not outside the spec. Anything in between the json objects is meant to be thrown away if we have proper parsers. Yeah I've gone with some custom code to find the chunks of json that should take into account {} occurring within strings. If anyone is interested it is at 2661473e, which shows the change from basic bracket count chuncking to this new method. - Montellese - 2011-06-11 Hey everyone With this commit I just made it is now possible to use an optional "filter" parameter in JSONRPC.Introspect. As the full output of JSONRPC.Introspect is huge and probably a bit overwhelming and confusing I came up with the "filter" parameter which is an object and should contain an "id" and a "method" value. Here are a few examples of its use:
Use JSONRPC.Introspect to get all the possibilities the new "filter" parameter introduces. Basically you can filter by a method, type, notification or namespace. I hope this helps in finding out about what parameters to pass to a certain method and what you will get in return. - xblitz - 2011-06-11 I had submitted a bug a month ago... http://trac.xbmc.org/ticket/11538 I found where the problem is and updated the ticket.. but no one is the owner or in CC of the ticket so I guess no one got notified.. so if you guys can take a look.. would be great I also put suggestions to fixing the bug ! - bartdesign - 2011-06-12 I'm using the latest osx nightly and I'm trying to use the VideoLibraryGetRecentlyAddedEpisodes() to get the newest tv show episodes. But i'm missing a reference back to the tv show itself. Is it possible to get the tv show thumbnail? I've looked through introspect but i can't find an good solution. It would be nice to have the tvshow id returned with the Library.Fields.Episode. That way it would be easy to get an reference to a show from the recently added episodes. Another way to solve this is to create a function that returns the tvshowid with the episodeid as parameter, but that will create an extra call. - topfs2 - 2011-06-12 bartdesign Wrote:I'm using the latest osx nightly and I'm trying to use the VideoLibraryGetRecentlyAddedEpisodes() to get the newest tv show episodes. But i'm missing a reference back to the tv show itself. Is it possible to get the tv show thumbnail? I've looked through introspect but i can't find an good solution. I'd feature request this on trac, not sure if it is possible (easily) but it does seem like a very valid thing to have. |