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-01-10 litemotiv Wrote:I can't seem to get it working, what would be the sortmethod parameters for retrieving the album or artists lists, ordered by name/title? Do they use the database fields, or something else? You can see all the possible values of "sortmethod" in the following source file: https://github.com/xbmc/xbmc/blob/master/xbmc/lib/libjsonrpc/FileItemHandler.cpp Scroll down to the function called "CFileItemHandler:arseSortMethods" and you will see a whole list of possible values. - topfs2 - 2011-01-10 litemotiv Wrote:I can't seem to get it working, what would be the sortmethod parameters for retrieving the album or artists lists, ordered by name/title? Do they use the database fields, or something else? It is "sort": { "method": "foo", "order": "ascending" } - litemotiv - 2011-01-10 -- not necessary anymore -- - litemotiv - 2011-01-10 topfs2 Wrote:It is "sort": { "method": "foo", "order": "ascending" } Excellent, that works. Now the only thing i'm seeing is that there is a problem combining sort with limit. Sorting on "album" gives back the right list, but when i add start:0 and end:10, it gets the original first 10 (based on id), and then sorts them. It should be the other way around, first sort, then limit. Am i right? - topfs2 - 2011-01-10 litemotiv Wrote:Excellent, that works. It does sort then limit. - litemotiv - 2011-01-10 topfs2 Wrote:It does sort then limit. When i do this: Code: {"jsonrpc":"2.0","method":"AudioLibrary.GetAlbums","id":1,"params":{"sort":{"method":"album"},"start":0,"end":10}} I get this: Code: { When i do this: Code: {"jsonrpc":"2.0","method":"AudioLibrary.GetAlbums","id":1,"params":{"sort":{"method":"album"}}} I get this: Code: { - topfs2 - 2011-01-10 Try and add order ascending also EDIT: NVM, should not affect. Not sure what to tell you, the code states it is sort and limit. I need to verify this at some point but it should work - ndeshmukh - 2011-01-10 Is it possible to write a script addon so that in its settings page it lets you select a script for each event in xbmc. Basically to register callbacks. That way reliance on eventghost to do certain things can also be removed. Is there a way for addons to know of events? May be possible to have a callbacks.xml file like advancedsettings.xml to register script callbacks for events? - litemotiv - 2011-01-10 topfs2 Wrote:Try and add order ascending also Ok, it would be great if someone can verify that this works. If you have any information or questions about the crash with AudioPlaylist.GetItems, please let me know. - Montellese - 2011-01-10 I also noticed some unexpected results when using "sort" or "start" and "end". I'll look into this and try to debug the code and maybe I can come up with an explanation. - topfs2 - 2011-01-10 ndeshmukh Wrote:Is it possible to write a script addon so that in its settings page it lets you select a script for each event in xbmc. Basically to register callbacks. That way reliance on eventghost to do certain things can also be removed. Is there a way for addons to know of events? Throught jsonrpc you can register on many events, check jsonrpc.introspect for the correct registration. Python have its own event mechanism which might be superseeded by jsonrpc if we decide to unify it. Display single picture - sunny-hd - 2011-01-11 Hi, I read through the posts trying to find a command to display a single picture stored on my NAS. Starting a Slideshow of a directory works fine. Code: {"jsonrpc": "2.0", "method": "XBMC.StartSlideshow","params": { "directory": "/Volumes/Pictures/2008_Afrika/" }, "id": 1} To show a a specific picture out of that directory I tried. Code: {"jsonrpc": "2.0", "method": "XBMC.Play", "params": { "file": "/Volumes/Pictures/2008_Afrika/103-0311.JPG" }, "id": 1} Code: {"jsonrpc": "2.0", "method": "XBMC.StartSlideshow","params": { "directory": "/Volumes/Pictures/2008_Afrika/103-0311.JPG" }, "id": 1} How do I display a single Picture? Thanks Klaus - Hiram - 2011-01-12 Hi guys, just wondering if there's a way to get the video sources via JSON-RPC? As in, get the directory path containing movies, one containing TV shows etc? I suspect there's not, but I thought I'd double check as I greatly need something like this. Edit: Found it myself! Fantastic. For any who find seek this information, it's Files.GetSources. - litemotiv - 2011-01-13 litemotiv Wrote:If you have any information or questions about the crash with AudioPlaylist.GetItems, please let me know. No crashes with the git version, so i assume it's something weird in -release. Also nice to see that GetGenres works in dev, so all is good. Now to sort out this sorting issue, time for more testing. Rather remove System.GetInfoBooleans than fix bug ?? - vaton4 - 2011-01-13 topfs2 Wrote:Comment to ticket #11044: JSON-RPC command 'System.GetInfoBooleans' does not work properly (by topfs2): OK, you are the boss, but then you should add "isRandom" to Audio/VideoPlaylist.GetInfo return else nobody will be able to determine whether playlist is shuffled or not. If Shuffle/Unshuffle commands exist, there should be some way to get feedback, as randomizing playlist can be done trough other controls (infrared, for example) so using local status flag is unreliable. Strange that "paused" and "playing" values are returned by several commands while "IsRandom" - and other flags as well - are available just by System.GetInfoBooleans. Until you delete it.... |