How to Reload Service from Kodi when developing?
#1
Hi,

Hacking away at a service (to aid with the mediaplayer). To save time and keep focus, I need a better way to refresh my code changes.
Changes made to the code does not take effect until the service is disabled+enabled (IE reloaded).

1. Is there a way to add a "Reload service(s)" developers key, like the "F5" for the skinning?, or alternatively,
2. Is there a way to have a button do the same?

Thanks! (from one noob hacker navigating waaay to much into addons>services>myService.. disable>enable.. )
Reply
#2
workaround for now is send disable/enable through a JSON-RPC command. This could be wrapped in an execute buildin which can probably be mapped to a button or triggered by a script that runs by a key.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
Thanks Martijjn,

As I am already pretty gawd daimn far down the Rabbit Hole already would anyone kindly provide a working script for this? I.. *whatsthat*.. just... *pants heavily*.. want.. *turns on yet another torch*.. a mediaplayer/db... *turns around another corner in the maze to end all mazes*.. combo with a god-diddely-fiddely-damnit... *It can be skinned they said..* normal.. *Cannot remember he sun on my skin anymore*.. GUI.
Reply
#4
To extend what Martijn is saying above - you don't need a script.
Assuming, you're developing on a platform that runs a browser - do what I do, just create the the enable/disable urls (or whatever json query), bookmark them in the browser and leave the browser window open while debugging your code. Just flip to the browser window, click the bookmark to do the command you want. Quick and dirty.
Reply
#5
Hi learningit.

Do you think it would be possible to see that url?
Reply
#6
Code:
http://localhost/jsonrpc?request={"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "plugin.video.cbsn", "enabled": false }}
set the "addonid" and "enabled" to your values first.
change localhost to the ip address or hostname if you are running the browser on a remote system.
Reply
#7
(2015-11-20, 14:51)learningit Wrote: To extend what Martijn is saying above - you don't need a script.
Assuming, you're developing on a platform that runs a browser - do what I do, just create the the enable/disable urls (or whatever json query), bookmark them in the browser and leave the browser window open while debugging your code. Just flip to the browser window, click the bookmark to do the command you want. Quick and dirty.

Now that's clever, will save me no end of time Smile
Reply
#8
me as well, thanx for the tips!
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#9
Wow great info. Thanks!
Reply
#10
And thank you from me too! Smile
Reply
#11
Ultimately I just want to force enable live tv and run pvr.simpleiptv from start
Reply
#12
Hi FresnoTV did you find a solution?
Reply
#13
Hi y'all.

Just tried the solution proposed by learningit.

It works...but if you want to use it with Kodi 18 you can't use the browser.

As described here (third paragraph), the JSON-RPC API does not allow http-calls for specific methods (I suppose those that change stuff on remote).

So to get the solution of learningit going, you'll have to resort to CURL, as described here (what I don't get is, that it still seems to be an http-call).

My way for restarting an addon remotely:

bash:

#!/usr/bin/env bash

# Deactivate addon
curl --data-binary '{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "service.pyfoehn", "enabled": false }}' -H 'content-type: application/json;' http://root:[email protected]:8080/jsonrpc

# Activate addon
curl --data-binary '{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "service.pyfoehn", "enabled": true }}' -H 'content-type: application/json;' http://root:[email protected]:8080/jsonrpc

So long.
Reply

Logout Mark Read Team Forum Stats Members Help
How to Reload Service from Kodi when developing?1