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
|
- giftie - 2011-04-06 Montellese Wrote:Everyone interested in JSON RPC please read http://forum.xbmc.org/showthread.php?p=767487 carefully. Awesome work Montellese! That was a big undertaking... And it didn't break my Addon Or should I say, my addon survived.. - carmenm - 2011-04-06 Montellese Wrote:Do you mean info of tv episodes? Because a playlist item can not be a tv show, but only a tv episode. "genre" and "tagline" are no valid fields for a tv episode but "runtime" and "rating" are. Please create a bug ticket so I don't forget about it. Yes i was talking about tvepisode. ok for genre and tagline. I added the bug THanks - marksoccer - 2011-04-06 Thanks for the new JSON API update. It looks like there are a bunch of new features I've been waiting for. However, I am having difficulty getting any audio items to play. Looking through introspect, I see XBMC.PLAY requires a filename now instead of accepting Playlist.Audio.Item. I tried using AudioPlaylist.Add and AudioPlaylist.Insert and received successful replies, but I still could not get the audio to play. Specifically, I am looking to provide an artistid and be able to play all the songs by that artist. Thanks again for all your hard work - carmenm - 2011-04-06 Is there a way with json to know if (or when) the videoPlayer switch from fullscreen to "show gui"? i have buttons that have different actions depending if on videoplayer or gui. For now i was relying on VideoPlayer playing status. But i just realized that i had the problem of the "show gui" during playback THanks - Montellese - 2011-04-06 marksoccer Wrote:However, I am having difficulty getting any audio items to play. Looking through introspect, I see XBMC.PLAY requires a filename now instead of accepting Playlist.Audio.Item. I tried using AudioPlaylist.Add and AudioPlaylist.Insert and received successful replies, but I still could not get the audio to play. Specifically, I am looking to provide an artistid and be able to play all the songs by that artist. Thanks again for all your hard workI removed all the parameters which caused some problems or didn't always work properly. If I have the time to fix them the parameters will be re-added. Did you try to run AudioPlaylist.Play() after using AudioPlaylist.Add? AudioPlaylist.Play() expects a parameter "item" which indicates the position of the item in the playlist to start playing. carmenm Wrote:Is there a way with json to know if (or when) the videoPlayer switch from fullscreen to "show gui"?There is no direct support in json rpc for any gui states but maybe you are lucky and find an InfoLabel (check the wiki) which can do this. - carmenm - 2011-04-06 Thanks for the info Montellese. By the way would it be possible to recover the movieid with VideoPlaylist.GetItems? should i add a feature request? (dont want to add it if not possible) - Montellese - 2011-04-06 carmenm Wrote:Thanks for the info Montellese. It would be possible but how would you know whether the id is for a movie, tv episode or a musicvideo. That would require an extra field and internal discussions resulted in postponing this issue until later. The primary goal was to get our json rpc api compliant with the 2.0 specification and to introduce the enhanced introspect and error messaging as that should make it a lot easier for 3rd party developers to use our API. - carmenm - 2011-04-06 and what about a getMovieDetails using file path? would it be possible? That would be enough. And it would solve the not knowing if episode/movie/musicvideo. - topfs2 - 2011-04-06 carmenm Wrote:Is there a way with json to know if (or when) the videoPlayer switch from fullscreen to "show gui"? I say put a ticket on this, we should notify on window change no matter and we could probably notify on player going to from fullscreen also, I agree its a nice state to track. For sure a good idea to have remotes look different when in fullscreen and when in GUI, so whatever makes that easier is good Cheers, Tobias. - Manromen - 2011-04-06 Hi, Since the API update I get an error with this json command: Quote:{'jsonrpc': '2.0', 'method': 'VideoLibrary.GetMovies','params':{'fields': ['title', 'year', 'originaltitle', 'imdbnumber', 'playcount', 'lastPlayed']}, 'id': 1} I don't get it, why I receive this error: Quote:{u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'Invalid params.', u'code': -32602, u'data': {u'method': u'VideoLibrary.GetMovies', u'stack': {u'message': u'array expected for array element at index 5 but array received', u'property': {u'message': u'Received value does not match any of the defined enum values', u'type': u'string'}, u'type': u'array', u'name': u'fields'}}}} Any idea ? - jitterjames - 2011-04-06 I understand that execbuiltin is not in the spirit of the JSON interface for XBMC, but there are certain functions that *we* basically can't live without. (some, like the first are just http api commands) - AddToPlayListFromDB (this one is huge for me - without it my voice control app is essentially broken) - Activate Window() - call an addon/script with a parameter (just having this might allow workarounds for other missing things) - commands like Container.PreviousViewMode,Container.SetViewMode(id) - sendkeys (it would be nice if we could send modified keys like "shift-F" there is currently no way to do this, not even with keyboard emulation because xbmc won't release the shift key) - Skin.ToggleSetting(setting), Skin.SetBool(setting), ReloadSkin() ...and quite a bit more. I am happy to submit them all via trac, but I wanted to get some feedback first. - Are some of these already possible? - Have they already been rejected? - Can I submit a big list to trac or is it better to submit a request for each item? There are many other things that would make my voice control app way better (but that would benefit others as well) such as a command to filter the current list of items on various fields, jump to an item (by name or id) etc. I am currently sort of managing to do this by sending a sequence of sms keys, but to be honest, this method kind of sucks, especially since we can only filter on a single word, and jumping to a letter will jump past it and do other weird things if the list doesn't contain any items that start with that letter. It might also be nice to be able to get a list of items on screen (eg. all the movies on the current view). Perhaps accessed in the same basic manner as a playlist. Like I said, I can submit all these via the proper channels but I wanted to get a general sense of what would be possible. From what I can see, if I lost access to the http api and had to use what was in the JSON spec. now my program would not be worth using with XBMC any more. - topfs2 - 2011-04-06 jitterjames Wrote:- AddToPlayListFromDB (this one is huge for me - without it my voice control app is essentially broken)You can add anything to the playlists, movies, tvshows whatever. Just as you would get them. i.e. VideoPlaylist.Add(tvshowid = 12) jitterjames Wrote:- Activate Window() Please submit them as feature requests, please do one ticket for each method you want with as much information as possible. i.e. Full description how you want the params and the expected results in as many cases as possible. Names and namespaces and permissions would also be very good. Cheers, Tobias - Montellese - 2011-04-06 Manromen Wrote:Any idea ? It should be "lastplayed" and not "lastPlayed" but I'll have to think about whether it makes sense to change it to case insensitive or not. - jitterjames - 2011-04-06 topfs2 Wrote:You can add anything to the playlists, movies, tvshows whatever. Just as you would get them. i.e. VideoPlaylist.Add(tvshowid = 12) yes, but audioplaylist.add only appears to allow us to add a single item, So how would we add - All songs by artist "xyz" - All songs with genre "rock" etc it seems that I would need to request all items in the library and then filter them myself and then add each on individually by id. That doesn't seem very efficient to me, but maybe I misunderstand. - Manromen - 2011-04-06 Montellese Wrote:It should be "lastplayed" and not "lastPlayed" but I'll have to think about whether it makes sense to change it to case insensitive or not. Ah thank you, that was the problem. |