2020-01-30, 17:57
I added some conditions so it should only trigger if the required listitems are not empty, but I'm still getting the error if I navigate away too quickly. Is there a slight delay in the calculation triggering? Can you think of any way to avoid this error beyond slower navigating
Help is mucho appreciated.
Help is mucho appreciated.
xml:
<!--HiddenFocusButton-->
<include name="HiddenFocusButton">
<control type="button">
<visible allowhiddenfocus="true">false</visible>
<animation effect="slide" end="0,0" time="380" reversible="false">Focus</animation>
<onfocus condition="System.HasAddon(script.embuary.helper) + !String.IsEmpty(ListItem.Property(WatchedEpisodes)) + !String.IsEmpty(ListItem.Property(TotalEpisodes)) + !String.IsEqual(ListItem.Overlay,OverlayWatched.png) + [Container.Content(tvshows) | Container.Content(seasons)]">RunScript(script.embuary.helper,action=calc,do='"($INFO[ListItem.Property(WatchedEpisodes)] / $INFO[ListItem.Property(TotalEpisodes)]) * 100"',prop=MyResult)</onfocus>
<onfocus condition="System.HasAddon(script.embuary.helper) + !String.IsEmpty(Container.TotalWatched) + !String.IsEmpty(Container.NumItems) + [Control.IsVisible(500) + Container.Content(episodes) + !Skin.String(DetailedListView_Display,Square)]">RunScript(script.embuary.helper,action=calc,do='"($INFO[Container.TotalWatched] / $INFO[Container.NumItems]) * 100"',prop=MyResult)</onfocus>
<onunfocus condition="!String.IsEmpty(Window(Home).Property(MyResult))">ClearProperty(MyResult,home)</onunfocus>
</control>
</include>