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
|
- mikebzh44 - 2012-01-25 Thanks very much for this usefull answer. I'm running Eden beta 2. - mikebzh44 - 2012-01-25 I'm trying to query movies database : Code: json_query = xbmc.executeJSONRPC('{"jsonrpc": "3.0", "method": "VideoLibrary.GetMovies", "params": {"properties": ["file", "fanart", "thumbnail"]}, "id": 1}') but it raise an error Code: JSONRPC: Failed to parse '{"id":1,"jsonrpc":"3.0","method":"VideoLibrary.GetMovies","params":{"properties":["file","fanart","thumbnail"]}}' Everything is OK vith V2.0 JSONRPC : Code: json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"properties": ["file", "fanart", "thumbnail"]}, "id": 1}') Calling method is different ? Sorry but I'm discovering XBMC, python, XML, ... - Montellese - 2012-01-25 Hehe the version you provide in "jsonrpc" in your request must be "2.0" and it does not relate to the version of XBMC's JSON-RPC API but the version of the JSON-RPC specification implemented by XBMC. So there's the version for the JSON-RPC implementation (which is "2.0") and the version of XBMC's JSON-RPC API (which currently is 3) but you don't need to specify XBMC's JSON-RPC API as you can't choose between the different versions. If you want to know what version of XBMC's JSON-RPC API you are using, you can call JSONRPC.Version. - mikebzh44 - 2012-01-25 Sorry, I have misunderstoud the versions. Now, everything is clear. Thanks. - Mizaki - 2012-01-29 Does VideoLibrary.GetMovieSets ignore movie sets that only contain 1 movie? themoviedb scrapper seems to fetch the set info for movies now. I added a movie that is part of a set. If I retrieve the movie info details I get a setid of 10. GetMovieSets does not return that id. In the DB it is there linked to the movie id as expected. - Montellese - 2012-01-29 Mizaki Wrote:Does VideoLibrary.GetMovieSets ignore movie sets that only contain 1 movie? Yes that's how XBMC handles sets. A set only exists if there are at least two movies in it. - Mizaki - 2012-01-29 That makes sense but should getmoviedetails return a set then? May seem a silly question but this is the problem: Request movie details. Returns setid. Query movie set details by setid. Errors. I have to therefore verify the movie set details. Which I can do but seems a little non-intuitive. - Mizaki - 2012-01-29 I think Files.GetDirectory is getting confused. Code: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params" : { "directory" : "special://profile/playlists/video/tv.xsp", "media" : "video", "properties": ["artist", "album", "showtitle", "episode", "season"] }, "id": 1} Code: {"album":"","artist":"","episode":14,"file":"/mnt/nanika/TV2/The Big Bang Theory/","filetype":"directory","id":342,"label":"The Big Bang Theory","season":-1,"showtitle":"The Big Bang Theory","type":"unknown"} Test playlist is: Code: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - Montellese - 2012-01-29 What are you expecting it to return? For a tvshow or season the "episode" property returns how many episodes the tvshow/season contains. - Mizaki - 2012-01-29 I'm expecting nothing or -1 like season. It returns the episode number when retrieving an episode. But if that's correct then season should return the number of seasons? And then being a pendant it should be seasons and episodes. Also, it'll be incorrect if you have seasons/series folders as GetDirectories isn't recursive. - Montellese - 2012-01-29 If you don't expect anything why do you even retrieve the values? Compare this with how VideoLibrary.GetTVShows works. It can provide an "episode" field which will return the number of episodes in a tvshow but it does not have a "season" field. That's why you get -1 for "season" but 14 for "episode". We didn't introduce an extra field "episodes" because the meaning is always defined by the type of the item (tvshow, season, episode). Furthermore having "episode" and "episodes" would be prone to hard-to-find typing errors. EDIT: I just spotted another bug in there. The "type" is returned as "unknown" even though it should be "tvshow". I just fixed it in https://github.com/xbmc/xbmc/commit/18409c3c402c5767d93f0e5f5d41993d8603d913 - Mizaki - 2012-01-29 I retrieve it as a general catch all. I'm using GetDirectories to process a smart playlist which could contain anything (hence the artist and album as well). No worries, I can ignore it if the type comes back as tvshow. I just thought it was incorrect. - Montellese - 2012-01-29 Mizaki Wrote:That makes sense but should getmoviedetails return a set then? May seem a silly question but this is the problem: Could you please create a bug report for this problem on trac. I agree that for every setid returned by another JSON-RPC call the call to VideoLibrary.GetMovieSetDetails should return the existing details. But I looked into the code and it's far from an easy fix. The problem lies in the general implementation of sets in XBMC and the fact that sets with only one movie are not considered as such when listing them in the GUI. - Mizaki - 2012-01-29 http://trac.xbmc.org/ticket/12558 Hopefully it makes sense. - Tolriq - 2012-01-30 I'm getting quite a strange bug with Xbmc Json android and authentication. For authentication i use the simple basic way with the Authorization header. (But i got the same result with Authenticator). If i disable Xbmc auth, all my code works perfect. If i enable password all standard json requests works ok. But all batch request send a parse error. The logs in debug shows : Quote:01:49:42 T:12112 DEBUG: JSONRPC: Incoming request: User-Agent: Dalvik/1.4.0 (Linux; U; Android 2.3.6; GT-I9100 Build/GINGERBREAD)with the exact same code on second earlier : Quote:01:49:41 T:12112 DEBUG: JSONRPC: Incoming request: {"id":1,"jsonrpc":"2.0","method":"Player.GetActivePlayers"} I'm quite lost ... but it looks like a problem with some headers request size and Xbmc. |