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
|
RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-10-04 Something must have broken since then, as: Code: { results in: Code: [ RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2013-10-04 if you use: PHP Code: "clearart": "null" my code is a bit missleading as i had to add the 'null' to be able to pass it to the other code RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-10-04 (2013-10-04, 11:20)Martijn Wrote: if you use: I've tried just about every combination - with/without quotes! Didn't think your version would work (the result was entirely expected) but I gave it a shot anyway! It seems that any attempt to pass an empty string ("") or null/None will fail. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-10-05 Note that I've confirmed the same behaviour in Frodo 12.2: "", None, null all return an error, and setting a single member of art[] does not remove the remaining members. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jmarshall - 2013-10-05 This is likely due to CVideoDatabase::SetArtForItem() basically just iterating through the art you pass in and adding each item. i.e. there's no removal (just replacement). Given the way that we might go and look for more art if it turns out to be not in the database at all (e.g. no fanart entry at all) it might be wise to define empty/None as being clear. If so, all that needs doing is making sure JSON-RPC supports this. By the looks it's intentionally non-empty currently: https://github.com/xbmc/xbmc/blob/master/xbmc/interfaces/json-rpc/types.json#L359 @Montellese I'm sure will let us know whether this can be changed to a string or not. Jonathan RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-10-05 (2013-10-05, 05:06)jmarshall Wrote: it might be wise to define empty/None as being clear. Thanks Jonathan. Do you mean "clear" as in, "interpet this artwork item as not being set" (while still writing it to the database, albeit empty), or "clear" as in "remove the item when updating the database"? Although the former would be fine (I think - it would depend on how other add-ons are testing if a value exists), it would be nice to have the option to be able to remove those items that you don't want/need in the database. Ideally it would be possible to give an item a value such as None (or null) meaning that the item won't then be written back to the database, effectively removing it. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jmarshall - 2013-10-05 Yes, I think we could remove them. I was initially hesitant about doing so, because if XBMC finds no art at all for an item then it will go and grab local art. As long as there's one, though, it should be OK. So yeah, the ability to specify None or null rather than just the empty string (though we could just as well interpret the empty string as meaning remove). Let's wait and see what Montellese thinks. Cheers, Jonathan RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-10-05 IMHO empty string ("") should continue to be interpreted as just that, and the item left in the database - there's plenty of examples where fields exist today that are set to the empty string (eg. lastplayed, trailer etc.) which could cause problems if they suddenly started disappearing from the database. null/None on the other hand is fairly unambiguous, and a suitable trigger for removal. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jmarshall - 2013-10-05 I wasn't suggesting applying empty string -> remove for everything. Just for art. But agreed that None/null is less ambiguous. AW: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-10-05 Supporting null (and empty strings) in the interface is certainly possible. The question is how to pass the null value on to CVideoDatabase since it expects a map<string,string>. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jmarshall - 2013-10-05 Either pass as empty string, or (better) add a ClearArtForItem() RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-10-06 So there would be logic in JSON-RPC code that would detected the null'ed artwork types and call ClearArtForItem for those artwork types? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-10-06 Hi There is a way to get the actual XBMC profile using JSON ? I need to identify what profile is running and then create some actions based on that, the user have two profiles, one for music and another for movie. I tried to found, but no luck until now. Very thanks Clayton RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-10-06 (2013-10-06, 00:56)claymic Wrote: Hi The "Profiles" namespace has been added very recently to the gotham nightly builds. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jmarshall - 2013-10-06 Montellese: Yup, I reckon that's the best way to go. |