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
|
- jasonvp - 2011-07-19 Montellese Wrote:"Library.Id" is a custom type that is defined in the json schema returned by JSONRPC.Introspect as well. What you can do is execute Thanks a lot. It was my mistake that I was not getting any responses because I had not scanned my music through the Context Menu. First time user of XBMC. I guess it helps if your read the manual...doh! Thanks again. Cheers Jason Now playing item - mjeanrichard - 2011-07-22 Hi! I am developing an Interface based on JSON-RPC. For the "Now playing" screen I use the playlist.getItems method to get the playlist and its current field to find out which is currently playing. BUT: If I remove the item, that is currently playing from the playlist (Playlist.Remove) the song keeps playing in XBMC (which ist ok). But now, the "current" field of the playlist.getItems method is not pointing so the current song since that song is not in the playlist anymore. Is there any way to get the now playing song if the song is not in the playlist? Thanks for your help! - topfs2 - 2011-07-22 mjeanrichard Wrote:Hi! Are you using Playlist or the [Audio|Video]Playlist? you need to use the latter one for now playing (we want to switch this at a later stage when core works like it). - mjeanrichard - 2011-07-22 I am using AudioPlaylist.GetItems. also, if I have a Playlist that looks like this: Song1 Song2 Song3 Song4 Lets assume that Song3 is currently playing. If I query AudioPlaylist.GetItems the current field is 2, which is correct. If I remove Song1 from the playlist and requery getitems the current field is still 2, wich is wrong now, since Song3 is now on position 1. It seems like the current field is only updated when the next song is played and not when the playlist is modified...?? - topfs2 - 2011-07-22 mjeanrichard Wrote:I am using AudioPlaylist.GetItems. That is a bug for sure. Please submit a bugreport and CC me and montellese. Thanks. - mjeanrichard - 2011-07-22 Ok, created Ticket http://trac.xbmc.org/ticket/11763. Thanks for your help. Files.Download - jasonvp - 2011-07-30 Hi Guys, Does Files.Download work? I tried this, Code: {"jsonrpc":"2.0","id":1,"method":"Files.Download","params":"special://masterprofile/Thumbnails/Music/4/4484673b.tbn"} All I get is, Code: {"error":{"code":-32600,"message":"Invalid request."},"id":1,"jsonrpc":"2.0"} Are my params incorrect? What does Files.Download return, the image or path? I had a look in the introspect but Files.Download is not there. I'm using Nightly Build-20110715-5bbc9c2-master (windows XP). I also tried to install the latest Nightly Build XBMCSetup-20110729-29bfb97-master.exe 29-Jul-2011 10:18 which installed but would not run. Cheers Jason - topfs2 - 2011-07-30 jasonvp Wrote:Hi Guys, That request is not valid on json-rpc 2.0 and has been changed in version 3, this is the schema for that method: Code: "Files.Download": { So you need to do Code: {"jsonrpc":"2.0","id":1,"method":"Files.Download","params":{"path": "special://masterprofile/Thumbnails/Music/4/4484673b.tbn"}} jasonvp Wrote:What does Files.Download return, the image or path? Its hard to define what Files.Download "does" as it will depend on each transport. Essentially it initiates or prepares the server so that it can do a download, it will return something which will show you how to do the download. So parsing the data it returns depends on the transport. To explain it way less complicated as the only transport implementing it is http, it will point to a path you can use to download the file. Cheers, Tobias - jasonvp - 2011-07-30 Hi Tobias, Thanks for your help. I tried, Code: {"jsonrpc":"2.0","id":1,"method":"Files.Download","params":{"path":"special://masterprofile/Thumbnails/Music/4/4484673b.tbn"}} All I get is, Code: {"error":{"code":-32602,"message":"Invalid params."},"id":1,"jsonrpc":"2.0"} I'm using Hercules to test with and a Nevo S70 remote both of which I get the same response. Any idea's? Cheers Jason - jasonvp - 2011-07-31 Hi, So I tried, Code: {"jsonrpc":"2.0","id":1,"method":"Files.Download","params":{"path":"special://masterprofile/Thumbnails/Music/4/4484673b.tbn"}} Is this correct? I also tried, Code: {"jsonrpc":"2.0","id":1,"method":"JSONRPC.Ping"} Am I doing something wrong? Cheers Jason - topfs2 - 2011-07-31 If you get no response it sounds like the webserver isn't active or that you have a wrong location to post to. Would appreciate full debug logs. - thedroid - 2011-07-31 jasonvp Wrote:Am I doing something wrong? You need to add "/jsonrpc" to the end of your URL. - jasonvp - 2011-08-01 thedroid Wrote:You need to add "/jsonrpc" to the end of your URL. That's it. Thank you very much. Cheers Jason - othrayte - 2011-08-01 Background: I'm about to try adding support for scrobbling of streaming items using TraktUtilities and I have been checking what is required, I got ABC iView (I'm in Australia) to stream correctly, and the plugin that provides it has all the info, like title, season, episode, etc. and this is also present in the info screen when the video is being played. At my end TraktUtilities expects the 'data' part of the onPlay json notification to contain relevant data. When I play a normal episode from my library I get the following json message {"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"id":2459,"speed":1,"type":"episode"},"sender":"xbmc"}} But when a streamed video is played as follows: listitem=xbmcgui.ListItem(label=p.get_list_title(), iconImage=p.thumbnail, thumbnailImage=p.thumbnail) listitem.setInfo('video', p.get_xbmc_list_item()) xbmc.Player().play(rtmp_url, listitem) It is important to note that get_xbmc_list_item() provides all of the required info, like title, season, episode, etc. The json message that results is as follows: {"jsonrpc":"2.0","method":"Player.OnStop","params":{"data":null,"sender":"xbmc"}} This on has 'data' set to null What I want to know is, is it possible for the data passed to xbmc using the listitem to be passed on through the onplay message. I would think this would make the data useful for most of the streamed data that is played in this way. - topfs2 - 2011-08-01 othrayte Wrote:What I want to know is, is it possible for the data passed to xbmc using the listitem to be passed on through the onplay message. Well we have had the discussion internally and came to the conclusion that its impossible to tell what information the client wants. The only solution to that problem would either be send everything or just enough to query the server (which we have chosen). The benefit of query is that a client may utilize a cached copy if they so desire, further limiting the bandwith required by json-rpc clients. If the data presented in OnPlay isn't enough to query the server however, that would be a problem (which OnStop seems to lack in your example here, so please make a trac ticket for that). The downside is obviously that it introduces another step or client have to have a cache. However I think its still more clients which might benefit from getting the message as quickly as possible and then choose what to do with it than getting a 50x larger message to parse (number taken from nowhere but might be right ) There is a third option which would be having clients register what info they want available but that seems to be kindof a hornets nest as they might want different info in OnPlay on movies and episodes, which would make the API cluttered and a lot of extra code on the server. Hope that explains our design choice and hope you may agree on them I welcome discussion though incase we might have missed anything. Cheers, Tobias |