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
|
- Martijn - 2011-11-05 Is it possible to directly retrieve the total number of seasons of one tv show? For skins there is: Code: ListItem.Property(TotalSeasons) Is there something simulair for JSON? - Montellese - 2011-11-05 Not possible for now unless by calling VideoLibrary.GetSeasons. - Montellese - 2011-11-05 jimk72 Wrote:Not sure if this is a bug but when I start a movie in xbmc the onplay gives player Id 1 and when I play music in xbmc it gives id of 0. Which works fine but if I am listening to music and call player.open and send movieid it returns an onplay with playerid 0 when actually it should be 1. Calling a getitem with player 0 returns error but getitem playerid 1 returns the movie info? This commit should fix the problem for both media started through Player.Open and media started through recentlyadded: https://github.com/xbmc/xbmc/commit/5748f59f3194a3021f353fba9096c7380a2e0807 But the media is still not added to the correct playlist but notifications now contain the correct playerid. - Martijn - 2011-11-05 Montellese Wrote:Not possible for now unless by calling VideoLibrary.GetSeasons. Is this something that could be included in the future (if yes should i create a request ticket) or just stick to the 'VideoLibrary.GetSeasons' ? I have some problem retrieving the tvshow ID. All it returns is : none What am I doing wrong in this code: Code: findtvshowid = re.search( '"tvshowid":"(.*?)","', mediaitem ) Complete code: http://pastebin.com/cWHXQxSa Log: http://pastebin.com/ZZZnLKZ9 - Montellese - 2011-11-05 Machine-Sanctum Wrote:Is this something that could be included in the future (if yes should i create a request ticket) or just stick to the 'VideoLibrary.GetSeasons' ? I'll have to see if it will increase the query retrieval time or not. Feel free to create a feature request ticket. Quote:I have some problem retrieving the tvshow ID. All it returns is : none I still don't understand why you guys aren't usin JSON libraries. It makes using the data from the responses sooo much easier. In your case the regex is wrong because there are no double-quotes around an integer value. Furthermore most of your regexes will fail if someone disables compact JSON output through Advanced Settings (like I have to better debug). - Martijn - 2011-11-05 Montellese Wrote:I'll have to see if it will increase the query retrieval time or not. Feel free to create a feature request ticket.If it won't make things. I'll create a feature request ticket anyway. Quote:I still don't understand why you guys aren't usin JSON libraries. It makes using the data from the responses sooo much easier. In your case the regex is wrong because there are no double-quotes around an integer value. Furthermore most of your regexes will fail if someone disables compact JSON output through Advanced Settings (like I have to better debug).I removedd the double quote however this created another error. You mean the way logo-downloader handles requests for how it should be coded? Well I only started to learn python couple of weeks ago so it was the choice of the other guys. So i'm just learning as i go along and just expanding the existing code. Still little lost in all the python/JSON coding - ronie - 2011-11-05 Machine-Sanctum Wrote:You mean the way logo-downloader handles requests? there's a simplejson script module in our addon repo that could/should be used instead of doing regex matches on the results. i only found out about it last night (thanx pieh) :-) like you, i used the existing scripts as an example when i started creating python addons....guess we've all been doing it wrong right from the start. - Martijn - 2011-11-05 ronie Wrote:there's a simplejson script module in our addon repo that could/should be used instead of doing regex matches on the results. Well we took some of our code from the logo-downloader What's it called and is there a readme/example included on how to use it? Also found some cache handle script however there's no readme/examples included. - ronie - 2011-11-05 Machine-Sanctum Wrote:Well we took some of our code from the logo-downloader script.module.simplejson/ PHP Code: import simplejson Machine-Sanctum Wrote:Also found some cache handle script however there's no readme/examples included. and you want us to guess the name of the scipt? count me in! what's the first prize? - Martijn - 2011-11-05 ronie Wrote:and you want us to guess the name of the scipt? Haha sorry forgot about that Could be wrong however maybe you can shed some light on what it actually does. http://mirrors.xbmc.org/addons/eden-pre/script.common.plugin.cache/ Sorry for the off-topic. - Martijn - 2011-11-05 EDIT: Nevermind. Found it the previous problem. Altough still have this problem: Code: if jsonobject_season['result'].has_key('limits'): Code: 15:56:06 T:1108 ERROR: Traceback (most recent call last): - Martijn - 2011-11-05 Machine-Sanctum Wrote:Altough still have this problem: I tried several things, read some documentation however i'm to inexperienced to solve the problem above on my own The rest of it all function without a problem. If some one could give a hand i would be grateful - Montellese - 2011-11-05 I don't really know python but from looking at the code this line doesn't make much sense to me: Code: for item in jsonobject_season['result']['limits']: Code: item['total'] Something like this might work Code: if jsonobject_season['result'].has_key('limits'): - Martijn - 2011-11-05 Montellese Wrote:I don't really know python but from looking at the code this line doesn't make much sense to me: Well you know enough. It worked. Thanks - jimk72 - 2011-11-05 Thanks for the update about the onplay! I redid a lot and am now using http to get and post JSON. tcp seems fine to send json but when you recieve it(especially if getting entire artist list,4000+) it is so fragmented you have to do preparsing to make sure you have the entire request recieved. Now using http I get the entire json for each singular request. Everything works perfect. Am also using superobject to parse the json. I did have one request: does anyone know if there is a shortcut to get the image of a album that has no thumbnail, empty artist thumbnail, empty movie thumbnail? These are the images xbmc displays when no image is avail. I know I could just find them in the source for xbmc but then I am using their images in my program. I would rather either load them through http from xbmc or instead of xbmc json returning "thumbnail":"" it could return the path to the default thumbnail xbmc uses. Hope that wasnt to complicated. |