Is there a possibility to read RunScript parameters via Favourites.GetFavourites
#1
If I add a script with parameter to Kodi's favorites, is there a way to read the parameters via JSON API, ideally via Favourites.GetFavourites?

Examples:
Code:
<favourite name="Test script" >RunScript("service.autostop","sleep=60")</favourite>
or
Code:
<favourite name="Test script" >RunScript("service.autostop","sleep","60")</favourite>

I am only aware of the ability to read the path to the script, but not the parameters.
Reply
#2
(2024-10-19, 19:07)Buschel Wrote: If I add a script with parameter to Kodi's favorites, is there a way to read the parameters via JSON API, ideally via Favourites.GetFavourites?
(2024-10-19, 19:07)Buschel Wrote: I am only aware of the ability to read the path to the script, but not the parameters.

isn't the path the entire portion inside the bracket so then you just need to parse it?
 
Code:
<favourite name="Test script">PATH</favourite>
Reply
#3
(2024-10-20, 20:36)izprtxqkft Wrote: isn't the path the entire portion inside the bracket so then you just need to parse it?
 
Code:
<favourite name="Test script">PATH</favourite>

No.

For the example
Code:
<favourite name="Test script" >RunScript("service.autostop","sleep=60")</favourite>
I only receive "service.autostop" as path.
Reply
#4
Looking at favourites.cpp in the code I don't see that favourites pass anything but the addon id for RunScript or RunAddon.  Maybe the assumption is that it would be a plugin?  Did you try running this from the favourites window in Kodi?  Does it work there (turn on debug and you will log the args passed to python)?

scott s.
.
Reply
#5
(2024-10-19, 19:07)Buschel Wrote: If I add a script with parameter to Kodi's favorites, is there a way to read the parameters via JSON API, ideally via Favourites.GetFavourites?

Examples:
Code:
<favourite name="Test script" >RunScript("service.autostop","sleep=60")</favourite>
or
Code:
<favourite name="Test script" >RunScript("service.autostop","sleep","60")</favourite>

I am only aware of the ability to read the path to the script, but not the parameters.

Just an FYI, I author the service.autostop addon and it currently doesn't accept any parameters.  You simply just call he addon and it just increments through the various sleep timer values.  It won't accept a direct value insertion. 


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#6
Thanks for the hint. I just took this from a discussions we had on GitHub a while ago (#865), and use this simply for figuring out how to read script parameters for Favourites via JSON API.

Let me also give this a bit more context. An iOS App user raised a use case where scripts with parameters are added to Favourites. And it is possible to call those from Kodi UI, but the remote fails to call the parameters. See this thread.

To be able to support this I would need to read these script parameters and add them when issuing the JSON command to execute the script on the Kodi system. From the JSON API I see no obvious way to obtain such parameters. I just wanted to ask, if there are ways I did miss. Preferred would be to add a new return parameter to Favourite.Details.Favourite.
Reply
#7
(2024-10-21, 06:41)Buschel Wrote: Thanks for the hint. I just took this from a discussions we had on GitHub a while ago (#865), and use this simply for figuring out how to read script parameters for Favourites via JSON API.

Let me also give this a bit more context. An iOS App user raised a use case where scripts with parameters are added to Favourites. And it is possible to call those from Kodi UI, but the remote fails to call the parameters. See this thread.

To be able to support this I would need to read these script parameters and add them when issuing the JSON command to execute the script on the Kodi system. From the JSON API I see no obvious way to obtain such parameters. I just wanted to ask, if there are ways I did miss. Preferred would be to add a new return parameter to Favourite.Details.Favourite.

Ahh thanks.  I had forgotten about the conversation because it was within GitHub area for your application.  


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Is there a possibility to read RunScript parameters via Favourites.GetFavourites0