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 - 2011-05-28 Mindzai Wrote:I'm sure this must have been asked but my searching hasn't turned up the answer. Where can I find details of the available fields for methods such as VideoLibrary.GetTVShowDetails and VideoLibrary.GetEpisodeDetails please? I notice the GetMovieDetails fields are listed in the wiki but not most other methods. Call JSONRPC.Introspect and study the answer. You will find all the available fields for the different methods there. If you don't know JSON schema yet (which is what JSONRPC.Introspect returns) this might help you understand better what you get back: http://tools.ietf.org/html/draft-zyp-json-schema-03 - Mindzai - 2011-05-28 Montellese Wrote:Call JSONRPC.Introspect and study the answer. You will find all the available fields for the different methods there. If you don't know JSON schema yet (which is what JSONRPC.Introspect returns) this might help you understand better what you get back: http://tools.ietf.org/html/draft-zyp-json-schema-03 I see, thanks for the help. I had tried introspecting but expected the parameters to be listed along with the method. I see that the parameter objects have their own section in the schema which I missed before. Sort order - Mizaki - 2011-05-29 Sort order desending doesn't appear to work. Code: {"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params": { "sort": { "order": "descending" }, "limits": { "end": 10 } }, "id": 1} Code: {"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params": { "sort": { "order": "descending" }}, "id": 1} Code: {"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params": { "sort": { "order": "ascending" }}, "id": 1} Or am I misunderstanding something? - Montellese - 2011-05-29 Mizaki Wrote:I've looked around and no one seems to have mentioned it. Something like:Feel free to create feature request tickets for those on trac. I think we once discussed it internally but we couldn't agree on what RecentlyAddedSongs should return because if you e.g. add two new albums and RecentlyAddedSongs only returns 10 songs you will only get the 10 last songs from the last album added. Mizaki Wrote:Sort order desending doesn't appear to work. You are missing the "sort method". The default method is "none" and if there is no sort ordering you can't really invert the order either. If you e.g. use the sort method "album" or "year" and change between "descending" and "ascending" order you will see a difference. - Mizaki - 2011-05-30 Okay, I've added a request http://trac.xbmc.org/ticket/11594 As you probably guessed I was trying to get around the lack of recently added. I see what you are saying but although I'm not specifying a method currently the method of "none" returns the albums in id order, acsending. Albumid is not a valid method for sort, so I was expecting, with the use of desending, the albums to be returned in desending order by albumid. I would suggest that either the id (albumid, movieid etc.) be allowed in the sort method or that desending with none returns the items in reverse id order. I realise that "none" should mean none but I can't see another way to get the items in reverse id order? - vikjon0 - 2011-06-05 topfs2 Wrote:If you give the outside world access to your mysql it is your setup not XBMC which gives access to it. The same if you give remote access to the sqldb file, its a big difference between YOU giving remote programs all access to the database and XBMC ALWAYS giving all access to the database. JSONRPC gives access based on what the client requests and on a per client basis, so a nfo editor may change the data but your phone may only read. I totally understand the approach but will you support at least readonly SQL queries when the http api is removed? There will always be something missing and while adding it to the new api is the way to go that means quite some lead time if you develop add-ons for existing stable. Assuming sql is only used while waiting for the next stable, changes to db model is not an issue since the code is only meant to be used in one version before being replaced with a api call. - topfs2 - 2011-06-05 vikjon0 Wrote:I totally understand the approach but will you support at least readonly SQL queries when the http api is removed? There will always be something missing and while adding it to the new api is the way to go that means quite some lead time if you develop add-ons for existing stable. No, if your missing something feature request it and we will add it proper instead. No point in allowing hacks, all that will do is make people reluctant to feature request. EDIT: And I doubt we will disable httpapi in eden, if anything eden will be the last it is available in, but it won't be just disabled until one stable after we deprecate, now its only on will-be-deprecated basis - vikjon0 - 2011-06-05 topfs2 Wrote:No, if your missing something feature request it and we will add it proper instead. No point in allowing hacks, all that will do is make people reluctant to feature request. Yes, allowing hack will most likely have that effect. So basically if I miss something for an add-on I log a request (or make a patch) and push the add-on to next stable? How isolated is the api? Could it be an option in the future to release the api interface more frequently than core? I guess one could just make a hack un-official add-on and clean it upp next stable. - mzanetti - 2011-06-05 I'm getting different character sets in responses to *Library.Get* calls. For example "label" seems to be encoded with UTF8, while "file" seems to be encoded with latin1. This is an example snippet of a response to Library.GetSongs(): Code: ... Is this intentional or should I file a bugreport? This makes it difficult to convert the string always appropriate. Thanks - topfs2 - 2011-06-05 vikjon0 Wrote:Yes, allowing hack will most likely have that effect. yup. Generally me and montellese discuss a lot and we have quite a clear roadmap what we want changed til next stable. We haven't really pushed the roadmap pubblic though as we can't really promise anything In any event, if you miss something make us knowing and we will try to get it in to next release. If you can make patches to core that would be even more appreciated. Its kindof like with skin changes, we try to keep a log about what has changed so users of the API can stay up to date during the dev cycle. We will freeze the API quite some time before a stable to have addon creators time to adjust. Cheers, TObias - billylg - 2011-06-07 Hi Newbie here, Got a question on using Json RPC. I am trying to figure out how to make JSON RPC calls for a project. I am using the Simple REST client on chrome to test the request and response. I could quite figure out how to get audio playing. The request I sent is the following: { "jsonrpc": "2.0", "method": "XBMC.Play", "params": {"name": "C:\music.mp3", type: "audio"}, "id": 1 } And the response I got back is: {"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"} Can someone tell me what I am doing wrong? Thanks for the help! - mzanetti - 2011-06-07 billylg Wrote:Hi Newbie here, You have to use AudioPlaylist.Add to add your song items. After that you may use AudioPlaylist.Play with an index in that playlist. - Montellese - 2011-06-07 billylg Wrote:Hi Newbie here, "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 In this particular case the problem is the backslash in your path which is used as an escape character so you need to add another one in front of it (\\) to escape it. Hope this helped. - Manromen - 2011-06-07 Does something changed for the recent linux nightly builds (20110606)? We have a Trakt Utilities addon user reporting issues with the following call not returning a tvshowid: {'jsonrpc': '2.0', 'method': 'VideoLibrary.GetTVShows','params':{'fields': ['title', 'year', 'imdbnumber', 'playcount']}, 'id': 1} Edit: He uses a mysql database. - Montellese - 2011-06-07 Manromen Wrote:Does something changed for the recent linux nightly builds (20110606)? Works for me on latest nightly and nothing in that area changed but I'm on Windows and I don't use mysql. |