Solved Time in hours and minutes
#1
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
Reply
#2
perhaps the scripts are broken due to the recent changes to the ListItem.Duration infolabel:
http://forum.kodi.tv/showthread.php?tid=...pid2485188
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
#3
... that is for nightly builds only btw, should still work as is in Kodi Krypton.
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
#4
unfortunately I doesn't work for me. And the skin helper only works on the DialogVideoInfo, but not on the views
Reply
#5
Maybe you find this interesting...

http://forum.kodi.tv/showthread.php?tid=233015
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#6
(2017-02-20, 14:43)manfeed Wrote: Maybe you find this interesting...

http://forum.kodi.tv/showthread.php?tid=233015
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]
Reply
#7
Rainbow 
<label>$INFO[ListItem.Duration(h)]h $INFO[ListItem.Duration(m)]m[CR]</label>                 
<visible allowhiddenfocus="true">!String.IsEmpty(ListItem.Duration)</visible>
Reply

Logout Mark Read Team Forum Stats Members Help
Time in hours and minutes1