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 - Mizaki - 2012-05-19 Okay, on the query all artists thing. That's fine but you have to use the GUI which if you want to use XBMC as a music player having to turn on the monitor/TV to get the artist info is a bit of a pain. How easy would it be to make the query all artists a JSONRPC command? Say AudioLibrary.QueryAllArtists. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jonib - 2012-05-19 (2012-05-19, 21:26)Montellese Wrote:I was afraid of that. Do you think that's something that's going to change or would it need a big redesign of XBMC?(2012-05-19, 21:07)jonib Wrote: So I'm wondering why the Player.OnStop notification is different depending on if I stop a media file manually or if it stops by itself? If a video for example stops by itself I get no title or anything else but if I stop the video I get the title and other useful info. So another thing a discovered while testing the notifications. If I play a video that's not in the XBMC library the Player.OnPlay and other events include an empty Title property and no other identifiable info so making the event less useful, is it possible to add a path or something? Thanks for the quick reply. jonib RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-19 Workaround for not returning an error is in place: https://github.com/xbmc/xbmc/commit/2e75130efa69624c7b75488a3eace9f58f8b0ee7 The problem with invoking things like "query all artist info", "refresh single movie" etc is that they always involve the scanner, its dialog and a scraper and last time I played with invoking those through JSON-RPC it sometimes worked fine, sometimes it crashed and sometimes it messed up my database. IMO it's not that much of a pain to start your monitor/tv once after having scanned all your music and then running "query all artist info". It's not like you have to run it all the time. You scan your music library (for which you might even have to turn your monitor on anyway if you e.g. need to add a new source) and then you run "query all artist info" and you should be golden. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-19 (2012-05-19, 22:02)jonib Wrote: I was afraid of that. Do you think that's something that's going to change or would it need a big redesign of XBMC?Can you create a bug report for this on Trac? I won't have time to look into it in the next few weeks but it's certainly something that should be fixed. (2012-05-19, 22:02)jonib Wrote: So another thing a discovered while testing the notifications.Yes those are more or less useless in Eden but should have been improved in the nightly builds (although I haven't tested it because I never watch anything that's not in xbmc's library (except movie traileres)). EDIT: As an example this is the Player.OnPlay notification for the Expendables 2 trailer: Code: { "jsonrpc": "2.0", "method": "Player.OnPlay", "params": { "data": { "item": { "type": "movie" }, "player": { "playerid": 1, "speed": 1 }, "title": "The Expendables 2", "year": 2012 }, "sender": "xbmc" } RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-05-19 Okay. Can you let us know when the notifications are considered working again with AE? No mute notifications and none when changing the volume within XBMC. Oddly I get notifications on volume change when using JSONRPC command. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-19 AE has broken a lot of notifications and I still need gnif to fix those (especially the ones involving music playback as he re-wrote the whole music player). RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jonib - 2012-05-20 (2012-05-19, 22:08)Montellese Wrote:Ticket 13050 created. Hopefully it has all needed info.(2012-05-19, 22:02)jonib Wrote: I was afraid of that. Do you think that's something that's going to change or would it need a big redesign of XBMC?Can you create a bug report for this on Trac? I won't have time to look into it in the next few weeks but it's certainly something that should be fixed. jonib RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-20 (2012-05-20, 03:54)jonib Wrote:(2012-05-19, 22:08)Montellese Wrote:Ticket 13050 created. Hopefully it has all needed info.(2012-05-19, 22:02)jonib Wrote: I was afraid of that. Do you think that's something that's going to change or would it need a big redesign of XBMC?Can you create a bug report for this on Trac? I won't have time to look into it in the next few weeks but it's certainly something that should be fixed. And fixed. Was actually easier than I thought. Back when I introduced notifications the old behaviour was the only way but someone must have adjusted/fixed the internal logic in the meantime so now Player.OnStop should always contain details independent of whether playback stops automatically or through user interaction. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jonib - 2012-05-20 (2012-05-20, 10:48)Montellese Wrote:Cool, thanks. Do you know which nightly will include the fix?(2012-05-20, 03:54)jonib Wrote:(2012-05-19, 22:08)Montellese Wrote: Can you create a bug report for this on Trac? I won't have time to look into it in the next few weeks but it's certainly something that should be fixed.Ticket 13050 created. Hopefully it has all needed info. jonib RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-20 I'd say the one that is built tomorrow morning (May 21st). RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - joethefox - 2012-05-21 I have a little problem. When xbmc accesses to the filesystem, and this takes time to respond (such as hard drives in stand-by) the entire xbmc interface stops responding (playback continues smooth) as well as JSON-RPC interface stops responding. When hard drives are awakened everything returns to normal. I can deal this, just to know if something can be done to prevent this behavior. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Livin - 2012-05-21 (2012-05-19, 22:08)Montellese Wrote:(2012-05-19, 22:02)jonib Wrote: So another thing a discovered while testing the notifications.Yes those are more or less useless in Eden but should have been improved in the nightly builds (although I haven't tested it because I never watch anything that's not in xbmc's library (except movie traileres)). I hope you will consider adding some more usable info here. I'd like to track the usage for kids/guest/etc and better info is necessary to do so. Even something simple like passing <filename> as ' title' and properly identifying 'type' as "video file" or "audio file" (identifying anything unknown as "movie" causes tracking problems) thx! RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-21 (2012-05-21, 19:56)joethefox Wrote: I have a little problem. When xbmc accesses to the filesystem, and this takes time to respond (such as hard drives in stand-by) the entire xbmc interface stops responding (playback continues smooth) as well as JSON-RPC interface stops responding. When hard drives are awakened everything returns to normal. I can deal this, just to know if something can be done to prevent this behavior.That's because all the filesystem interaction is synchronous with the GUI so if you open a directory in XBMC's file manager the GUI will "freeze" until the whole content of the directory has been read and processed by XBMC. This has nothing to do with JSON-RPC and is a general "flaw" in XBMC's design. (2012-05-21, 20:42)Livin Wrote: I hope you will consider adding some more usable info here. I'd like to track the usage for kids/guest/etc and better info is necessary to do so. Even something simple like passing <filename> as ' title' and properly identifying 'type' as "video file" or "audio file" (identifying anything unknown as "movie" causes tracking problems)If JSON-RPC can't determine what kind of item is being played it should return "type": "unknown" unless the addon (or whatever you use to watch content that is not in the library) provides false information which leads to JSON-RPC using that for notifications. Generally notifications should be as short as possible because they are messages that are "forced" on the client, it's not something a client manually requests. Furthermore they take up the transport medium for the time of the transport and no response to a (manual) request can be sent while a notification is being sent to the client. That being said I'm always open to specific ideas what could enhance Player notifications for non-library files. When this feature was requested during v3 we narrowed the most important properties down to what JSON-RPC currently sends. For a (non-library) movie the title and year should be enough to identify the movie with google or on IMDb or TMDb if getting more info is that important to a client. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - joethefox - 2012-05-21 (2012-05-21, 21:41)Montellese Wrote: That's because all the filesystem interaction is synchronous with the GUI so if you open a directory in XBMC's file manager the GUI will "freeze" until the whole content of the directory has been read and processed by XBMC. This has nothing to do with JSON-RPC and is a general "flaw" in XBMC's design.just because I'm afraid of being unclear: JSON-RPC (at least with http connection) stops responding too and not just the GUI. This is out from your control? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-21 (2012-05-21, 21:57)joethefox Wrote: just because I'm afraid of being unclear: JSON-RPC (at least with http connection) stops responding too and not just the GUI. This is out from your control? Currently XBMC's webserver supports 4 simultaneous threads and therefore 4 simultaneous json-rpc requests. But as most json-rpc request require access to XBMC's core functionality it also requires access to methods/processes/information which are blocked by a (long-lasting) filesystem access. Requests like JSONRPC.Ping, JSONRPC.Version etc should still work (as long as you haven't already sent 4 other requests which are blocked because of the filesystem access) but especially player and input interaction etc will not be possible during such a period. |