The demise of HTTP API...
#16
Yup that looks right but you don't need the "+" between "Auto Library Updater". The URL-encoding will take care of that. If you want a response, you need to add
Code:
, "id": 1
after
Code:
"params": { ... }
i.e.
Code:
{ "jsonrpc": "2.0", "method": "GUI.ShowNotification", "params": { "string": "Auto Library Updater", "message": "Auto Library Updater" }, "id": 1 }
No "id" means no response.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#17
Hum did not think about no id no answer.

Is there any speed advantage to not set the id when no answer is needed or it doesn't matter ?
Reply
#18
You simply safe the call to the JSON serializer (which usually takes about 1 millisecond except for huge data like JSONRPC.Introspect) and the HTTP response is smaller and therefore less data has to be transferred but in a LAN you most likely won't notice that either.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#19
(2012-10-06, 01:44)giftie Wrote: Screensaver - The script displays a trivia slide show for upto 60 min's. Often users have set the screen saver to come on well before that(Mine is set to 10mins for example) Being able to disable the screensaver stops XBMC from interupting the slideshow. The script first checks to see what mode the screensaver is set to, copies it, then disables it. When the script comes to an end it restores the screensaver to it's former glory. It is also wrapped in error checking code so if the script fails it also returns the setting back, no protection against XBMC hanging or crashing.
Sounds more like a bug in XBMC to me. IMO the screensaver shouldn't kick in if a slideshow is running in XBMC like it doesn't kick in when watching a movie.

(2012-10-06, 01:44)giftie Wrote: Auto Refresh
The scripts builds a playlist of videos that surround a selected Movie(gives the feel of being at a movie theatre) The videos that are available are often at different refresh rates. If the user has the auto refresh setting on, this introduces interuptions to the flow of the playlist. Disabling the refresh during everything else other than the Movie(what we are really here for) smooths out the flow. This option is controllable by the user via addon settings.
I don't know anything about auto refresh rates etc but this sounds like a general problem in XBMC as well. What kind of "interruptions" are you talking about? Does this also happen if you create a normal video playlist in XBMC with those videos?
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#20
For those using wget and complains about reading being bad. I'd like to suggest using curl and just use PUT instead of GET. e.g.

Code:
curl -i -X POST -d '{"jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": 1}' http://localhost:8080/jsonrpc
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#21
(2012-10-11, 10:40)Montellese Wrote:
(2012-10-06, 01:44)giftie Wrote: Screensaver - The script displays a trivia slide show for upto 60 min's. Often users have set the screen saver to come on well before that(Mine is set to 10mins for example) Being able to disable the screensaver stops XBMC from interupting the slideshow. The script first checks to see what mode the screensaver is set to, copies it, then disables it. When the script comes to an end it restores the screensaver to it's former glory. It is also wrapped in error checking code so if the script fails it also returns the setting back, no protection against XBMC hanging or crashing.
Sounds more like a bug in XBMC to me. IMO the screensaver shouldn't kick in if a slideshow is running in XBMC like it doesn't kick in when watching a movie.
The script creates a slideshow internally(not using the XBMC Slideshow) This script has been around for a long time, when XBMC's slideshow function was not as good as it is now. I'll look into using the built in slideshow function.

Quote:
(2012-10-06, 01:44)giftie Wrote: Auto Refresh
The scripts builds a playlist of videos that surround a selected Movie(gives the feel of being at a movie theatre) The videos that are available are often at different refresh rates. If the user has the auto refresh setting on, this introduces interuptions to the flow of the playlist. Disabling the refresh during everything else other than the Movie(what we are really here for) smooths out the flow. This option is controllable by the user via addon settings.
I don't know anything about auto refresh rates etc but this sounds like a general problem in XBMC as well. What kind of "interruptions" are you talking about? Does this also happen if you create a normal video playlist in XBMC with those videos?
If the setting 'Adjust display refresh rate to match video' is enabled, it does this on a normal video playlist as well. The interuptions is not an aspect of XBMC to be honest, but the video display switching refresh rates(personally I have a DVDO video scaler, so I never see the interruptions.) HTTP API's access to the settings just provided me a method to satisfy user request(I don't feel bad removing it Smile )

I also just realized that there was one more HTTP API call in the script but I know direct database access won't be added(ie using SQL calls)

Reply
#22
(2012-10-12, 03:01)giftie Wrote: The script creates a slideshow internally(not using the XBMC Slideshow) This script has been around for a long time, when XBMC's slideshow function was not as good as it is now. I'll look into using the built in slideshow function.
Ah right, well XBMC's slideshow functionality is still not very good but certainly usable.

(2012-10-12, 03:01)giftie Wrote: I also just realized that there was one more HTTP API call in the script but I know direct database access won't be added(ie using SQL calls)

Depending on what you want to do it's possible with JSON-RPC.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#23
I have no idea where to post this as I've read quite a few threads about using curl and JSON to update your library, but I have finally figured out the command thanks to this post and a comment on Stack Overflow. I believe this is Windows curl specific but the -H switch needs to be passed specifying the content type (-H "Content-Type: application/json")

In hopes that other people with the same issue of trying to replace the old HTTP curl request for updating the video library
Code:
C:\cURL\curl.exe --get "http://xbmc:[email protected]:8082/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"
(Rather than setup an environment variable I've just hardcoded the path)

Here is the command to do it with json:

Code:
C:\cURL\curl.exe -i -H "Content-Type: application/json" -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\"}" http://username:password@ipaddress:port/jsonrpc

For example:
Code:
C:\cURL\curl.exe -i -H "Content-Type: application/json" -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\"}" http://xbmc:[email protected]:8082/jsonrpc

Thank you and may Google lead others to this post.
ATV2 running XBMC Eden (Skin: Quartz3)
Windows 7 running XBMC Eden (custom setup as I'm basically running it as a service)
MySQL installed on Windows 7 for sharing libraries
iOS Specific FAQ | Alternative ATV2 keymap | Default ATV2 keymap
Post log files to Pastebin

Image
Reply

Logout Mark Read Team Forum Stats Members Help
The demise of HTTP API...0