Kodi Community Forum

Full Version: Time Duration Format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to change time duration minutes (132 minutes) format to hour (2h 12m) format?

Titan Skin Netflix 2 - Krypton

Thanks
Its missing.
espeacially  in titan for leia..

Must be set up in includesvariables.xml

xml:

.......example
<value condition="String.StartsWith(ListItem.Duration,01:31Smile">1h31</value>

must be integrated there....cant confirm.
but i remember had trouble by deactivate h duration wasnt working in titan leia.

EDIT: if its just for one view type, or easier.


Testet now and works good....if you use that you can ignore the variables xml.
But you can set it up there too.
xml:
$INFO[ListItem.Duration(hh,, h]$INFO[ListItem.Duration(mm,, min]    <!-- choose what should stay after ...-->
If its just for Titan, you can use this for includesVariables.xml

Its also a BUG fix, when enebled " Dont Show hours in info" in the skin , it will no longer show booth

LINE 273 includesVariables.xml
xml:

includesVariables.xml
    <variable name="ListItemDuration">    <!--$INFO[Window(home).Property(SkinHelper.ListItem.RunTime),, $LOCALIZE[12391]] = Runtime in minutes) script.module.metadatautils\lib\helpers\utils.py-->
        <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !String.IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.RunTime),, $LOCALIZE[12391]]</value> <!-- default <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !String.IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.DurationAndRunTime)]</value> -->
        <value condition="!String.IsEmpty(ListItem.Duration) + !String.Contains(ListItem.Duration,min) + !String.Contains(ListItem.Duration,Smile">$INFO[ListItem.Duration,, min.]</value> <!-- $INFO[ListItem.Duration(hh,, h]$INFO[ListItem.Duration(mm,, min] -->
        <value condition="!String.IsEmpty(ListItem.Duration)">$INFO[ListItem.Duration(hh,,h] $INFO[ListItem.Duration(mm,,min]</value>
    </variable>
(2018-04-05, 19:10)mardukL Wrote: [ -> ]If its just for Titan, you can use this for includesVariables.xml

Its also a BUG fix, when enebled " Dont Show hours in info" in the skin , it will no longer show booth

LINE 273 includesVariables.xml
xml:

includesVariables.xml
    <variable name="ListItemDuration">    <!--$INFO[Window(home).Property(SkinHelper.ListItem.RunTime),, $LOCALIZE[12391]] = Runtime in minutes) script.module.metadatautils\lib\helpers\utils.py-->
        <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !String.IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.RunTime),, $LOCALIZE[12391]]</value> <!-- default <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !String.IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.DurationAndRunTime)]</value> -->
        <value condition="!String.IsEmpty(ListItem.Duration) + !String.Contains(ListItem.Duration,min) + !String.Contains(ListItem.Duration,Smile">$INFO[ListItem.Duration,, min.]</value> <!-- $INFO[ListItem.Duration(hh,, h]$INFO[ListItem.Duration(mm,, min] -->
        <value condition="!String.IsEmpty(ListItem.Duration)">$INFO[ListItem.Duration(hh,,h] $INFO[ListItem.Duration(mm,,min]</value>
    </variable>
 Thank you, I tried but it wont work, still in minutes
(2018-04-06, 08:41)irafihggnaba Wrote: [ -> ]
(2018-04-05, 19:10)mardukL Wrote: [ -> ]If its just for Titan, you can use this for includesVariables.xml

Its also a BUG fix, when enebled " Dont Show hours in info" in the skin , it will no longer show booth

LINE 273 includesVariables.xml
xml:

includesVariables.xml
    <variable name="ListItemDuration">    <!--$INFO[Window(home).Property(SkinHelper.ListItem.RunTime),, $LOCALIZE[12391]] = Runtime in minutes) script.module.metadatautils\lib\helpers\utils.py-->
        <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !String.IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.RunTime),, $LOCALIZE[12391]]</value> <!-- default <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !String.IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.DurationAndRunTime)]</value> -->
        <value condition="!String.IsEmpty(ListItem.Duration) + !String.Contains(ListItem.Duration,min) + !String.Contains(ListItem.Duration,Smile">$INFO[ListItem.Duration,, min.]</value> <!-- $INFO[ListItem.Duration(hh,, h]$INFO[ListItem.Duration(mm,, min] -->
        <value condition="!String.IsEmpty(ListItem.Duration)">$INFO[ListItem.Duration(hh,,h] $INFO[ListItem.Duration(mm,,min]</value>
    </variable>
 Thank you, I tried but it wont work, still in minutes   
EDIT


You should be able to switch via settings in titan.

settimgs-> skin -> geneneral skin setting -> disable hours duration on / off slider

I forget, the code is for Leia, for Krypton you should just replace the last line of code to get ** h ** min, instead of **:**:**
(2018-04-06, 10:22)mardukL Wrote: [ -> ]
(2018-04-06, 08:41)irafihggnaba Wrote: [ -> ]
(2018-04-05, 19:10)mardukL Wrote: [ -> ]If its just for Titan, you can use this for includesVariables.xml

Its also a BUG fix, when enebled " Dont Show hours in info" in the skin , it will no longer show booth

LINE 273 includesVariables.xml
xml:

includesVariables.xml
    <variable name="ListItemDuration">    <!--$INFO[Window(home).Property(SkinHelper.ListItem.RunTime),, $LOCALIZE[12391]] = Runtime in minutes) script.module.metadatautils\lib\helpers\utils.py-->
        <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !String.IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.RunTime),, $LOCALIZE[12391]]</value> <!-- default <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !String.IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.DurationAndRunTime)]</value> -->
        <value condition="!String.IsEmpty(ListItem.Duration) + !String.Contains(ListItem.Duration,min) + !String.Contains(ListItem.Duration,Smile">$INFO[ListItem.Duration,, min.]</value> <!-- $INFO[ListItem.Duration(hh,, h]$INFO[ListItem.Duration(mm,, min] -->
        <value condition="!String.IsEmpty(ListItem.Duration)">$INFO[ListItem.Duration(hh,,h] $INFO[ListItem.Duration(mm,,min]</value>
    </variable>
 Thank you, I tried but it wont work, still in minutes   
EDIT


You should be able to switch via settings in titan.

settimgs-> skin -> geneneral skin setting -> disable hours duration on / off slider

I forget, the code is for Leia 
 yeah already tried that too. but it wont work  Confused
What does it show if enebled and disabled.

lets say a movie has 124 minutes runtime

to me its
124 mins if on
1h 4 mins if off.

default 1:04 if off (i think) 

not at home
(2018-04-06, 10:35)mardukL Wrote: [ -> ]What does it show if enebled and disabled.

lets say a movie has 124 minutes runtime

to me its
124 mins if on
1h 4 mins if off.

default 1:04 if off (i think) 

not at home
enabled: 136 minutes.

disabled: 2:16 (136 minutes).

if i disabled it, need to load 1 seconds to show up and sometimes it wont show like that, just regular 136 minutes.

what i want is 2h 16m
EDIT: HERE IS WORKING CODE :-D

xml:

    <variable name="ListItemDuration"> <!-- MODDED ; RunTime = MINUTES IN TOTAL, Duration =hh:mm-->
        <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.Duration.Hours,, h] $INFO[Window(home).Property(SkinHelper.ListItem.Duration.Minutes,, min] </value> <!-- TITAN SEETING HOURS ON -->
        <value condition="!IsEmpty(ListItem.Duration) + !SubString(ListItem.Duration,min) + !SubString(ListItem.Duration,Smile">$INFO[ListItem.Duration,, min.]</value> <!-- TITAN SEETING HOURS OFF -->
        <value condition="!IsEmpty(ListItem.Duration)">$INFO[ListItem.Duration]</value>
    </variable>


Still no time, but maybe this help your setup.

Source
xml:

"Duration": formatted_time,
"Duration.Hours": hours,
"Duration.Minutes": minutes,
"Runtime": total_minutes,
"RuntimeExtended": "%s %s" % (total_minutes, xbmc.getLocalizedString(12391)),
"DurationAndRuntime": "%s (%s min.)" % (formatted_time, total_minutes),
"DurationAndRuntimeExtended": "%s (%s %s)" % (formatted_time, total_minutes, xbmc.getLocalizedString(12391)) -->

Try to get info string
[s]
xml:

$INFO[Window(home).Property(SkinHelper.ListItem.Duration.Hours] h $INFO[Window(home).Property(SkinHelper.ListItem.Duration.Minutes] min
[/s]


And test.
I hope its not wrote that confusing.and still no idea if it will work.cant test myself cause not at home that weekend
(2018-04-07, 13:22)mardukL Wrote: [ -> ]EDIT: HERE IS WORKING CODE :-D

xml:

    <variable name="ListItemDuration"> <!-- MODDED ; RunTime = MINUTES IN TOTAL, Duration =hh:mm-->
        <value condition="!Skin.HasSetting(SkinHelper.DisableHoursDuration) + !IsEmpty(Window(home).Property(SkinHelper.ListItem.DurationAndRunTime))">$INFO[Window(home).Property(SkinHelper.ListItem.Duration.Hours,, h] $INFO[Window(home).Property(SkinHelper.ListItem.Duration.Minutes,, min] </value> <!-- TITAN SEETING HOURS ON -->
        <value condition="!IsEmpty(ListItem.Duration) + !SubString(ListItem.Duration,min) + !SubString(ListItem.Duration,Smile">$INFO[ListItem.Duration,, min.]</value> <!-- TITAN SEETING HOURS OFF -->
        <value condition="!IsEmpty(ListItem.Duration)">$INFO[ListItem.Duration]</value>
    </variable>


Still no time, but maybe this help your setup.

Source
xml:

"Duration": formatted_time,
"Duration.Hours": hours,
"Duration.Minutes": minutes,
"Runtime": total_minutes,
"RuntimeExtended": "%s %s" % (total_minutes, xbmc.getLocalizedString(12391)),
"DurationAndRuntime": "%s (%s min.)" % (formatted_time, total_minutes),
"DurationAndRuntimeExtended": "%s (%s %s)" % (formatted_time, total_minutes, xbmc.getLocalizedString(12391)) -->
Try to get info string
[s]
xml:

$INFO[Window(home).Property(SkinHelper.ListItem.Duration.Hours] h $INFO[Window(home).Property(SkinHelper.ListItem.Duration.Minutes] min
[/s]


And test.
I hope its not wrote that confusing.and still no idea if it will work.cant test myself cause not at home that weekend
Worked!! thank youuu  SmileSmile

Image