2010-10-01, 00:21
Awesome. That alone would make it totally worth the effort of recoding my app to use JSON!
jitterjames Wrote:Will the JSON interface allow calling a script with an argument?
I could never get that to work with the http interface, and it would be really sweet!
jitterjames Wrote:thanks, but I'm talking about calling python script that would run on xbmc. So for example if I wanted to create a custom OSD window in XBMC to show information sent from my program via JSON.
I'm sure that your code would still be helpful to look at for myself and others though.
curl -i -X POST -d '{"jsonrpc": "2.0", "method": "XBMC.SetVolume", "params": { "number": "90"}, "id": 1}' http://localhost:9019/jsonrpc
Quote:'{"jsonrpc": "2.0", "method": "XBMC.SetVolume", "params": ' + ui.value + ', "id": 1}'
erhnam Wrote:Anyone know how to do this?I think like this:
curl -i -X POST -d '{"jsonrpc": "2.0", "method": "XBMC.SetVolume", "params": 90, "id": 1}' http://localhost:9019/jsonrpc
pfeifer Wrote:I am working very happy with JsonRpc.
I need to know the workaround for have only the album_artist and not all the artists included for e.g. in compilation where the album_artist is in my case "Various Artists".
How may I modify the following code?
Code:{"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists", "params": { "start": 0, "sort": { "order": "ascending", "method": "artist" } }, "id": 1}
Thanks
Sandro
MKay Wrote:Can anyone tell me how to handle virtual playlists correctly?
Actually i only need an AudioPlaylist (and of course a VideoPlaylist) where i can add and remove songs and play a specific item. Everything works fine with the JSON-API except that there is no remove-method for AudioPlaylist and VideoPlaylist.
But there is a remove-method for virtual playlists. So i considered to use virtual playlists. But i don't know how to handle them correctly.
I know i can use Playlist.Create to create a v-playlist and Playlist.Add to add songs, albums and files. And then i can use XBMC.Play to play the v-playlist. But what about playlist changes? For example i remove some elements from the v-playlist. How do i pass the new v-playlist to the currently playing one without stopping the current song or restarting the playlist from the beginning?
jitterjames Wrote:thanks, but I'm talking about calling python script that would run on xbmc. So for example if I wanted to create a custom OSD window in XBMC to show information sent from my program via JSON. (edit: or if I wanted to perform multi-command macros, it might be more efficient to make one call to a python script and have it execute the various steps, rather than sending multiple commands via JSON)
I'm sure that your code would still be helpful to look at for myself and others though.
jitterjames Wrote:thanks, but I'm talking about calling python script that would run on xbmc. So for example if I wanted to create a custom OSD window in XBMC to show information sent from my program via JSON. (edit: or if I wanted to perform multi-command macros, it might be more efficient to make one call to a python script and have it execute the various steps, rather than sending multiple commands via JSON)
I'm sure that your code would still be helpful to look at for myself and others though.