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-11-12 yallah Wrote:Hi,No JSON-RPC doesn't allow access to plugins (yet). jimk72 Wrote:Im starting to work on the playlist part of my program and noticed the result does not give you a limits like most other results. Is this a bug or is it supposed to be like this. Just trying to figure out how many playlists there are. Or do I have to call a diff method that will tell me how many playlists there are.Yes you are right, these are not accessible yet because you wouldn't be able to do anything with them. The Playlist namespace is responsible for loaded playlists only and user-generated playlists like Smartplaylists aren't loaded by default. In the future there will be VideoLibrary.GetPlaylists and AudioLibrary.GetPlaylists and a method in the Playlist namespace to load these playlists but currently that's not possible. othrayte Wrote:I have been using the JSONRPC.NotifyAll method recently, and it has been working fine but I've just tried to use it to pass data and the only thing that it is passing is a string representation of the basic types; ie a string is passed as a string, a number is passed as a string but more complex types like dictionaries, list and tuples are passed as empty strings. In the .json file it specifies that 'data' can be of type 'any'. Should I be able to pass the more complex types and why are the numbers converted to strings? I'll have to try this myself. I haven't used the NotifyAll method in months. - Montellese - 2011-11-12 othrayte Wrote:I have been using the JSONRPC.NotifyAll method recently, and it has been working fine but I've just tried to use it to pass data and the only thing that it is passing is a string representation of the basic types; ie a string is passed as a string, a number is passed as a string but more complex types like dictionaries, list and tuples are passed as empty strings. In the .json file it specifies that 'data' can be of type 'any'. Should I be able to pass the more complex types and why are the numbers converted to strings? You were right it was really bugged. Thanks for the report. Fixed in https://github.com/xbmc/xbmc/commit/6248d9db4498d5d92719371c9ce8d48cebda8858 so should be available in tomorrow's nightly build. - Tolriq - 2011-11-12 I'm starting to update Yatse to last Eden since JSON changes are slowing a little I've got a small question about Player.Open. What is the real way to use it ? For the moment for audio albums for example i build playlist then I send a simple : Quote:JSONCMD : Player.Open - {"item":{"playlistid":1}} But in XBMC logs it generates lots of warning : Quote:11:23:12 T:4652 WARNING: JSONRPC: Missing property "file" in type Do i really need to pass all those args ? What value should i use for them then ? Reading more the logs during writing it seems perhaps the warning are generated by : Quote:JSONCMD : Playlist.Add - {"item":{"songid":12},"playlistid":1} But the question remain - Montellese - 2011-11-12 Tolriq Wrote:I'm starting to update Yatse to last Eden since JSON changes are slowing a little You either create a playlist and then use the "playlistid" property of the "item" parameter or you just use the "albumid" property of the "item" parameter. The warnings in the log are wrong and I'll see about removing them. EDIT: I just made a commit that changes the level of those log messages from WARNING to DEBUG so if you don't have debug logging enabled you won't see them at all and if you do they shouldn't be alarming. Actually if there is something wrong with the parameters in your requests you will get an error response from JSON-RPC stating exactly what the problem is (which parameter, what type etc) so you don't really need to look into your log for any syntax-related JSON-RPC request problems. - Tolriq - 2011-11-12 Thanks for the quick feedback. - grywnn - 2011-11-12 Me again Bug? When i use Playlist.Swap and the position of the currently playing item changes, Player.getProperties doesn't reflect the changes afterwards. Example: Currently playing item 2 of playlist 0. Now i swap item 1 and 2. The item formerly known as item 2 continues to play, but is now on position 1. But Player.getProperties will still return position 2. This goes as far that even the music playlist on XBMCs screen reflects the swap, but highlights the wrong track. - replenish - 2011-11-12 Hi All, Currently running an XBMC nightly build (specifically xbmc-20111110-26cc297-master-i386) to try and build a webinterface plugin using the new JSON-RPC API. I appear to be having an issue with the VideoLibrary.GetSeasons method call. In the result set I expect an array of seasons which contains properties specified for Video.Details.Season in the API but I only ever seem to get an array of seasons containing the seasons labels and no other properties. Is the JSON-RPC API fully implemented in the nightly builds yet or am I missing something? Cheers. - jasonvp - 2011-11-12 grywnn Wrote:Me again Hi grywnn, This has been discussed before but I haven't submitted a bug ticket for it yet. You can if you like. jasonvp Wrote:I'm trying to use "Playlist.Swap" (in a similar way to "Move item" in the Context Menu) to move the currently playing song to another position. The problem is if say the currently playing song is at "position:6" and is moved to "position:0" the song moves correctly but the Playlist Position stays the same i.e. "position:6" instead of "position:0" (this is true in the GUI and "Player.GetProperties" results) so the next song to play is "position:7" instead of "position:1". http://forum.xbmc.org/showthread.php?tid=68263&page=138 Cheers Jason - Montellese - 2011-11-12 replenish Wrote:Hi All, In general all the GetFoo methods only return some very basic properties of the items. If you want more properties you need to specify them in your request. So if you e.g. the "tvshowid" and the "season" property for every returned season you need to specify that in the "properties" parameter of your request. Code: { "jsonrpc": "2.0", "method": "VideoLibrary.GetSeasons", "params": { "tvshowid": <some-id>, "properties": [ "season", "tvshowid" ] }, "id": 1 } - replenish - 2011-11-12 That makes total sense, just checked that out and it worked a treat thanks for the quick reply! - jimk72 - 2011-11-12 Montellese Wrote:No JSON-RPC doesn't allow access to plugins (yet). I can access the playlists through vfs/special://masterprofile/playlists/music/ then parse these and dynamicly create a playlist through json or just using notifications send the next song when the prev ends. Will this folder with the playlists continue to be avail after eden? Using this method I can have my program load other type playlists and compare song names and artists to send play commands to xbmc this will prob be the best solution till then. - RedsGT - 2011-11-13 I'm currently trying to replace some HTTP API code with JSON-RPC. Right now the code uses 'QueryVideoDatabase' to get the directory(s) of a tv show based on it's title and then used 'XBMC.updatelibrary(video, <directory>)' to initiate a library update based solely on that directory(s). 1. I've been trying to replicate this using ' VideoLibrary.GetTVShows', the problem being there is no way currently to filter the shows based on the various 'Video.Fields.TVShow' fields. Is asking for filter capability on this method a worthwhile feature request, or is there a better way to go about doing this (like just filtering client side)? 2. With 'XBMC.updatelibrary' from the HTTP API, I could update a single shows directory(s). Would it be a worthwhile feature request to ask for this functionality to be built into 'VideoLibrary.Scan'? - Montellese - 2011-11-13 RedsGT Wrote:I'm currently trying to replace some HTTP API code with JSON-RPC. Right now the code uses 'QueryVideoDatabase' to get the directory(s) of a tv show based on it's title and then used 'XBMC.updatelibrary(video, <directory>)' to initiate a library update based solely on that directory(s). IIRC there are feature requests for both of your points. Currently you'll have to do client side filtering but we are planning to provide filtering based on the SmartPlaylist filtering. The second isn't possible right now at all. - pilluli - 2011-11-13 Hello, I am trying to get all movies from the database that have resume bookmarks set using JSON in pre-eden. I am trying to call "VideoLibrary.GetMovies" but I seem unable to succeed. Is this currently possible or do I need to retrieve all movies and then parse the ones with resume positions > 0? Regards, - Montellese - 2011-11-13 pilluli Wrote:Is this currently possible or do I need to retrieve all movies and then parse the ones with resume positions > 0? That's what you'll have to do for now. |