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
|
- sooth - 2011-05-11 Montellese Wrote:This looks fine as long as "search" is an integer variable of a valid songid.Yes of course, I've verified it is. Montellese Wrote:Please try it with 0 for "item". IIRC the playlist entries start from 0 (as any index-based lists in most programming languages).First thing I tried. It just sits here and does nothing.. - Montellese - 2011-05-11 Did you open the Playlist in XBMC GUI and checked if your call to Add actually worked and if you can start playing that item from XBMC GUI? If that works the problem is somewhere in Play() otherwise it is a problem in Add(). Thanks for reporting back. - sooth - 2011-05-11 Nope, nothing visible in the GUI, not that I thought there would be though.. I'm looking to just queue up a bunch of songs and start playing them.. how can I do this? - Montellese - 2011-05-11 Where did you get the songid from you pass to the Playlist's Add() method? Best way is to get an artistid, albumid or songid from AudioLibrary.GetArtists, AudioLibrary.GetAlbums or AudioLibrary.GetSongs and then use the retrieved id in the Add() method. You can also pass an absolute path to a song using the "file" parameter or an absolute path to a directory containing (multiple) songs using the "directory" parameter. - sooth - 2011-05-12 Montellese Wrote:Where did you get the songid from you pass to the Playlist's Add() method? Best way is to get an artistid, albumid or songid from AudioLibrary.GetArtists, AudioLibrary.GetAlbums or AudioLibrary.GetSongs and then use the retrieved id in the Add() method. You can also pass an absolute path to a song using the "file" parameter or an absolute path to a directory containing (multiple) songs using the "directory" parameter. Yes that's what I am doing, however, when I pass the songid with the Add() method, nothing happens. It says the command completed, but nothing happens. If I call Play(), nothing happens.. - topfs2 - 2011-05-12 Please post a full Debug Log when you do the queries so we can see what is actually sent to xbmc. - sooth - 2011-05-12 http://pastebin.com/V0K8H0J9 - topfs2 - 2011-05-12 darnit, keep forgetting that we don't log all queries - sooth - 2011-05-12 topfs2 Wrote:darnit, keep forgetting that we don't log all queries Thanks for your help so far, you're really patient with everyone on this board. Can you provide me with any guidance? I'm totally confused here, I've followed what I believe is the correct way, I've even tested with the REST thingy in Chrome, and I get that my command was "OK" but nothing happens. I'm just trying to queue up some songs; trying to write a simple extension to my home automation software. EDIT: Here are the commands that I am running: Code: {"id":1,"jsonrpc":"2.0","method":"AudioLibrary.GetSongs", "params":{"artistid":31}} - sooth - 2011-05-12 Err does AudioLibrary.GetGenres no longer exist? - Montellese - 2011-05-12 It does in the git repository and it shouldn't have been removed. I can't test it because I'm still at university but the code suggests that it is still available. What version of XBMC are you using? - ppic - 2011-05-13 i've explored json.introspect http://pastebin.com/2P99BmGH but i can't find a way to get info on what's currently playing. does someone have a hint ? - Montellese - 2011-05-13 There's not a single method which returns the currently playing item because we want to provide as much specific information as possible about every item returned. What you need to do is call Player.GetActivePlayer which returns whether the audio, video or picture player is active. Based on that information you need to call AudioPlayer.GetItems or VideoPlayer.GetItems (pictures is not supported yet). Apart from the list of items in the playlist it will also return a value labeled "current" which returns the index of the currently playing item. - topfs2 - 2011-05-13 You get active player and query its playlist - ppic - 2011-05-13 ho yes i see ! thanks ! |