2019-11-08, 01:51
Edit: Figured this out using a hidden focuslayout button with <onfocus>: https://forum.kodi.tv/showthread.php?tid=288767
Thanks to @Hitcher for the solution
Original Post:
Apologies @sualfred in advance for the stupid question, I'm still fairly new to skinning and certainly to using scripts.
I'd like to use the Calc function of your Embuary Helper to pass a value for tvshows or seasons of ((watched episodes / total episodes) * 100) to get a watched percentage I can use for an image control width.
I've only been able to get this working on a manual left/right click in my vertical list with the following syntax.
But I don't know where to put this RunScript for it to automatically trigger each time the contents of my container is refreshed.
Thanks to @Hitcher for the solution
Original Post:
Apologies @sualfred in advance for the stupid question, I'm still fairly new to skinning and certainly to using scripts.
I'd like to use the Calc function of your Embuary Helper to pass a value for tvshows or seasons of ((watched episodes / total episodes) * 100) to get a watched percentage I can use for an image control width.
I've only been able to get this working on a manual left/right click in my vertical list with the following syntax.
xml:
<onleft condition="System.HasAddon(script.embuary.helper) + [container.content(tvshows) | container.content(seasons)]">RunScript(script.embuary.helper,action=calc,do='"($INFO[ListItem.Property(WatchedEpisodes)] / $INFO[ListItem.Property(TotalEpisodes)]) * 100"',prop=MyResult)</onleft>
<onright condition="System.HasAddon(script.embuary.helper) + [container.content(tvshows) | container.content(seasons)]">RunScript(script.embuary.helper,action=calc,do='"($INFO[ListItem.Property(WatchedEpisodes)] / $INFO[ListItem.Property(TotalEpisodes)]) * 100"',prop=MyResult)</onright>
But I don't know where to put this RunScript for it to automatically trigger each time the contents of my container is refreshed.