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 - Fuzzwah - 2013-06-24 Awesome, thanks guys. Will give this a shot when I'm back at home. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Fuzzwah - 2013-06-25 Alas, no joy. I'm able to add items to a playlist using: Code: curl -v -H 'Accept: application/json' -H 'Content-type: application/json' -X POST -d '{"jsonrpc":"2.0","method":"Playlist.Add","params":{"playlistid":0,"item":{"directory":"special://profile/playlists/music/NiN.m3u"}},"id":1}' http://192.168.0.16:8080/jsonrpc Which I can confirm using GetItems: Code: {"id":1,"jsonrpc":"2.0","result":{"items":[{"id":6324,"label":"04 - Sanctified.mp3","type":"song"},{"id":6325,"label":"05 - Something I Can Never Have.mp3","type":"song"},{"id":6386,"label":"12 - The Way Out Is Through.mp3","type":"song"},{"label":"Nine_Inch_Nails_-_piggy.mp3","type":"unknown"},{"id":6270,"label":"Nine Inch Nails - 15 - In This Twilight.mp3","type":"song"},{"id":6261,"label":"Nine Inch Nails - 06 - Me I'm Not.mp3","type":"song"},{"id":6391,"label":"05 - Please.mp3","type":"song"},{"label":"Nine_Inch_Nails_-_big_man_with_a_gun.mp3","type":"unknown"},{"label":"Nine_Inch_Nails_-_heresy.mp3","type":"unknown"},{"id":6393,"label":"07 - Complication.mp3","type":"song"},{"id":6380,"label":"06 - The Fragile.mp3","type":"song"},{"id":6397,"label":"11 - Ripe (With Decay).mp3","type":"song"},{"id":6381,"label":"07 - Just Like You Imagined.mp3","type":"song"},{"id":6378,"label":"04 - The Wretched.mp3","type":"song"},{"id":6263,"label":"Nine Inch Nails - 08 - My Violent Heart.mp3","type":"song"},{"id":6383,"label":"09 - Pilgramige.mp3","type":"song"},{"id":6394,"label":"08 - I'm Looking Forward To Joining You, Finally.mp3","type":"song"},{"id":6268,"label":"Nine Inch Nails - 13 - The Great Destroyer.mp3","type":"song"},{"id":6385,"label":"11 - La Mer.mp3","type":"song"},{"id":6379,"label":"05 - We're In This Together.mp3","type":"song"},{"id":6389,"label":"03 - Where Is Everybody_.mp3","type":"song"},{"id":6328,"label":"08 - That's What I Get.mp3","type":"song"},{"id":6326,"label":"06 - Kinda I Want To.mp3","type":"song"},{"id":6259,"label":"Nine Inch Nails - 04 - The Good Soldier.mp3","type":"song"},{"id":6395,"label":"09 - The Big Come Down.mp3","type":"song"},{"id":6329,"label":"09 - The Only Time.mp3","type":"song"},{"id":6377,"label":"03 - The Frail.mp3","type":"song"},{"id":6265,"label":"Nine Inch Nails - 10 - God Given.mp3","type":"song"},{"id":6264,"label":"Nine Inch Nails - 09 - The Warning.mp3","type":"song"},{"label":"Nine_Inch_Nails_-_march_of_the_pigs.mp3","type":"unknown"},{"id":6387,"label":"01 - The Way Out Is Through.mp3","type":"song"},{"id":6269,"label":"Nine Inch Nails - 14 - Another Version Of The Truth.mp3","type":"song"},{"id":6260,"label":"Nine Inch Nails - 05 - Vessel.mp3","type":"song"},{"id":6258,"label":"Nine Inch Nails - 03 - Survivalism.mp3","type":"song"},{"id":6375,"label":"01 - Somewhat Damaged.mp3","type":"song"},{"id":6266,"label":"Nine Inch Nails - 11 - Meet Your Master.mp3","type":"song"},{"id":6267,"label":"Nine Inch Nails - 12 - The Greater Good.mp3","type":"song"},{"id":6256,"label":"Nine Inch Nails - 01 - Hyperpower.mp3","type":"song"},{"id":6382,"label":"08 - Even Deeper.mp3","type":"song"},{"label":"Nine_Inch_Nails_-_closer.mp3","type":"unknown"},{"label":"Nine_Inch_Nails_-_ruiner.mp3","type":"unknown"},{"id":6257,"label":"Nine Inch Nails - 02 - The Beginning Of The End.mp3","type":"song"},{"id":6390,"label":"04 - The Mark Has Been Made.mp3","type":"song"},{"id":6392,"label":"06 - Starfuckers, Inc.mp3","type":"song"},{"id":6388,"label":"02 - Into The Void.mp3","type":"son* Connection #0 to host 192.168.0.16 left intact However, when I then try and send through the shuffle command: Code: curl -v -H 'Accept: application/json' -H 'Content-type: application/json' -X POST -d '{"jsonrpc":"2.0","method":"Player.SetShuffle","params":{"playerid": 0, "shuffle": true},"id":1}' http://192.168.0.16:8080/jsonrpc I get the following message: Code: {"error":{"code":-32100,"message":"Failed to execute method."},"id":1,"jsonrpc":"2.0"}* Closing connection #0 Then I just tried to get the damn playlist to play and can't even do that.... fail: Code: curl -v -H 'Accept: application/json' -H 'Content-type: application/json' -X POST -d '{"jsonrpc":"2.0","method":"Player.PlayPause","params":{"playerid": 0, "play": true},"id":1}' http://192.168.0.16:8080/jsonrpc Result: Code: {"error":{"code":-32100,"message":"Failed to execute method."},"id":1,"jsonrpc":"2.0"}* Closing connection #0 Any help is truly appreciated, starting to get a little frustrated at my failure to do something which seems pretty simple. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-06-25 Welcome to Xbmc in all it's beauty All your queries fails because no player are yet started. Once files are in playlist you need to Player.Open to start the player then you can shuffle and play/pause things. To simulate random also on first song just start the player.open with a random position in the playlist and not 0 RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Kabooga - 2013-06-25 Good point Tolriq. I should have mentioned that. Had to laugh at this one. Quote:Welcome to Xbmc in all it's beauty RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Fuzzwah - 2013-06-26 Awesome, I finally have my script set up which will kick off playback of a shuffled playlist....... but I have a bug. The volume seems to change somewhat randomly. My script clears the playlist (if any), sets the volume to 11, builds the playlist, player.open's the playlist and then shuffles the playlist. Code: #!/bin/bash But yeah, occasionally when a new track starts playing the volume will get set up to something like 50..... totally ear smashingly loud. Weird. Any clue as to what is happening? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-07-02 Hi A simple question. How i can see a image from the xmbc in my browser ? I tried in two ways. Quote:http://xmbc@myip:8080/image/image://Q%3a%5cMovies3tb2%5cFilmesHD3tb2%5cThe%20Ledge%20(2011)%5cThe%20Ledge%20(2011).bluray.tbn/The other way i am using in my ipad app and works in the Ipad, but dont work in another app that i am creating Quote:http://xmbc@myip:8080/vfs/image://Q%3a%5cMovies3tb2%5cFilmesHD3tb2%5cThe%20Ledge%20(2011)%5cThe%20Ledge%20(2011).bluray.tbn/Thanks for the help guys. Clayton RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-07-03 Sorry guys, my bad, i forgot to encode the "image://". Next question. There is any difference between the thumbnail path that we get from Frodo and Gotham ? Its the same ? Thanks Clayton RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jon889 - 2013-07-05 I'm trying to get the thumbnail for addons. the Addons.GetAddons returns exactly this: "image://%2fhome%2fxbian%2f.xbmc%2faddons%2fplugin.video.1channel%2ficon.png" So I thought I could just do: http://192.168.2.12:8080/image/image://%2fhome%2fxbian%2f.xbmc%2faddons%2fplugin.video.1channel%2ficon.png but I get no response, and the wiki says I have encode the image://... so this results in the path being double encoded: http://192.168.2.12:8080/image/image%3a%2f%2f%252fhome%252fxbian%252f.xbmc%252faddons%252fplugin.video.1channel%252ficon.png Is this really right? Also it's strange This returns a jpg: http://192.168.2.12:8080/image/image%3a%2f%2f%252fhome%252fxbian%252f.xbmc%252faddons%252fplugin.video.1channel%252ficon.png as does this: http://192.168.2.12:8080/image/image://%252fhome%252fxbian%252f.xbmc%252faddons%252fplugin.video.1channel%252ficon.png and this returns a png: http://192.168.2.12:8080/image/image://%2fhome%252fxbian%252f.xbmc%252faddons%252fplugin.video.1channel%252ficon.png (note how the slash before home is not double encoded) this gives no response: http://192.168.2.12:8080/image/image://%2fhome%2fxbian%252f.xbmc%252faddons%252fplugin.video.1channel%252ficon.png (note how the slash before and after home is not double encoded) this all seems illogical, so could someone clarify it? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - danmedhurst - 2013-07-11 via SSH : xbmc-send -a ContextMenu RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-07-15 Just noticed a change in last gotham during some tests. It seems that now neither the title nor the label are filled when playing a random file via JSON. Before label was filled with the filename (without path) and seems a good thing since the label is a mandatory item. Edit : After some debugging I'm lost on what seems multiple strange things, so don't know if they are errors or if normal and so where I should patch. In CPlayerOperations::GetItem Code: else if (player == Video) When playing a video file the second else block will also be called is this intended ? In CVideoLibrary::FillFileItem Code: CVideoDatabase videodatabase; Since the file is started from JSON for first time it's not yet in any database so Code: if (!videodatabase.LoadVideoInfo(strFilename, details)) Will return false and the label is never set. Then on the last part I'm not sure to understand, you test if the label is empty then set it, then you set if the label is present and set it again ? Not sure what part should be patched and with what So waiting for more details RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-07-15 (2013-07-15, 12:16)Tolriq Wrote: Just noticed a change in last gotham during some tests.Why? It's an else if (player == Video) which should be hit for video files and then it's an else which should only be hit for audio files (2013-07-15, 12:16)Tolriq Wrote: In CVideoLibrary::FillFileItemIt should be set/retrieved by CGUIInfoManager which also does this when playing a random file from the GUI. (2013-07-15, 12:16)Tolriq Wrote: Then on the last part I'm not sure to understand, you test if the label is empty then set it, then you set if the label is present and set it again ? That second if condition looks wrong and should be the same as the first one. It's possible that CUtil::GetTitleFromPath(strFilename, false) is not able to determine a title from the path and returns an empty string so as a last resort we just use the filename. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-07-15 Quote:Why? It's an else if (player == Video) which should be hit for video files and then it's an else which should only be hit for audio files Well using debugger it does goes in Perhaps some kind of compiler optimizations of whatever. (On the next part the else does contain player == Audio and does not trigger) Quote:It should be set/retrieved by CGUIInfoManager which also does this when playing a random file from the GUI. Well as you know when playing items from JSON we don't go through all the GUI things And since the Label is a mandatory field as per description and since the beginning it must be also returned in those cases. Quote:That second if condition looks wrong and should be the same as the first one. It's possible that CUtil::GetTitleFromPath(strFilename, false) is not able to determine a title from the path and returns an empty string so as a last resort we just use the filename. Thanks for confirming this code is also present in AudioLibrary code. The possible solutions are to either move the setlabels before the return false. (Should not be a problem since SetFromVideoInfoTag don't seems to override the label) Or to fill the label in GetItem code (seems less smart but well ) RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-07-15 I fixed the bad conditions in 80bb9b93db6a70762b7c05ed6b1e98451c9606bc. I don't have time to look at the rest now but will do later. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-07-15 I can't reproduce the problem you see in the debugger. If I start an MKV that is not in the library through Player.Open and then call Player.GetItem it does NOT go through the audio player specific code. I have done some refactoring to CFooLibrary::FillFileItem concerning the label (see db911a5f88ef054840b3dc3b98bf342845361506) although it doesn't make any difference when starting playback of an item but it makes a difference when using Player.GetItem. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-07-15 Does work now About the debugguer issue after a clean and full rebuild it does not do it again, maybe a bug with incremental build at some time. |