Kodi Community Forum

Full Version: Time in hours and minutes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was traing to change a skin that I'm using to display time in hours and minutes in the views. At first I used the script duration
PHP Code:
<variable name="LabelDuration">
<
value condition="System.HasAddon(script.duration)">$INFO[window.Property(Duration)]</value>
     <!--<
value condition="!IsEmpty(ListItem.Duration)">$INFO[ListItem.Duration,, $LOCALIZE[31102]]</value>-->
       <
value condition="[Container.Content(tvshows) + !Control.IsVisible(54) + !Control.IsVisible(555)] | Container.Content(episodes)">$VAR[LabelYear]</value>
    </
variable
and on myvideoNav I put this- <onload>RunScript(script.duration,backend=True)</onload>

Secound a tried the skin helper and don't work either
PHP Code:
<variable name="LabelDuration">
<
value condition="!IsEmpty(Window(Home).Property(SkinHelper.ListItem.Duration.Hours))">$INFO[Window(Home).Property(SkinHelper.ListItem.Duration.Hours)]h $INFO[Window(Home).Property(SkinHelper.ListItem.Duration.Minutes)]</value>
     <!--<
value condition="!IsEmpty(ListItem.Duration)">$INFO[ListItem.Duration,, $LOCALIZE[31102]]</value>-->
       <
value condition="[Container.Content(tvshows) + !Control.IsVisible(54) + !Control.IsVisible(555)] | Container.Content(episodes)">$VAR[LabelYear]</value>
    </
variable
and on myvideoNav I put this- <onload>RunScript(script.skin.helper.service,backend=True)</onload> don't know if this even works

What am I doing wrong or is it even possible now (script duration is discontinued for 2 years for example)
Thanks for the help in advance
perhaps the scripts are broken due to the recent changes to the ListItem.Duration infolabel:
2485188 (post)
... that is for nightly builds only btw, should still work as is in Kodi Krypton.
unfortunately I doesn't work for me. And the skin helper only works on the DialogVideoInfo, but not on the views
Maybe you find this interesting...

233015 (thread)
(2017-02-20, 14:43)manfeed Wrote: [ -> ]Maybe you find this interesting...

233015 (thread)
this code works. only has one problem. for example two movies, one with 2h20min and other with 2h02 min, this script returns 2h2 for both. But thanks for the effort

EDIT1- found one of the problems.
<value> </value> needs to be this <value>0 [LOWERCASE]$LOCALIZE[12391][/LOWERCASE]</value>. but on the 2H02 still returns 2h2

works better with this
<value condition="[SubString(ListItem.Duration,0,Right)    | !StringCompare(ListItem.Duration,60) | !StringCompare(ListItem.Duration,120) | !StringCompare(ListItem.Duration,180) | !StringCompare(ListItem.Duration,240)]">0 [LOWERCASE]$LOCALIZE[12391][/LOWERCASE]</value>

but the problem of 2h2 instead 2h02 is still present

EDIT2-I guess it's done - where only has $VAR[Durat_min] I put 0$VAR[Durat_min]
<label>$INFO[ListItem.Duration(h)]h $INFO[ListItem.Duration(m)]m[CR]</label>                 
<visible allowhiddenfocus="true">!String.IsEmpty(ListItem.Duration)</visible>