2015-09-22, 10:58
(2015-03-08, 23:05)twolaw Wrote: Hi all,
It was annoying me to see movies durations in minutes (for exemple: 157 minutes means nothing for a human being) so I wrote a script to fix this.
I prefer durations in HH:MM or HHhMM format so that's what this script do, it converts movies duration from minutes to hours & minutes to display it on a human-readable way.
2h35 is easier to understand than 155, right ?
I released it here : https://github.com/twolaw/script.duration
Of course, your skin has to be tweaked to trigger the script and to display the value calculated.
--------------------------------------------------------------------------------------------------------------------
HOW TO TWEAK YOUR SKIN
--------------------------------------------------------------------------------------------------------------------
These 3 files need to be modified as follow :
MyVideoNav.xml
Add <onload>RunScript(script.duration,backend=True)</onload> at the beginning.
variables.xml
Add this new variable at the end of the file (before the </include>) :
<variable name="MovieDuration">
<value condition="System.HasAddon(script.duration)">$INFO[window.Property(Duration)]</value>
<value>$INFO[ListItem.Duration]</value>
</variable>
Then, still in variables.xml, do those replacements :
$INFO[ListItem.Duration] replaced by $VAR[MovieDuration]
$INFO[ListItem.Duration,, $LOCALIZE[12391]] replaced by $VAR[MovieDuration]
$INFO[ListItem.Duration, • , $LOCALIZE[12391]] replaced by • $VAR[MovieDuration] (one space before and after the dot)
DialogVideoInfo.xml
Add <onload>RunScript(script.duration,duration=$INFO[ListItem.Duration])</onload> at the beginning.
Replace $INFO[ListItem.Duration] with $VAR[MovieDuration]
--------------------------------------------------------------------------------------------------------------------
This way, your skin can still work even if the script.duration is not installed.
It's my first script, so it must be far from perfection but it fully works on my HTPC.
Tell me what you think of it.
hi all im new here and now starting to get into kodi with all these fancy add ons,which i might say gets my mouth drooling loving the work you are doing but im confused,must be my age
anyway ive installed this lovely build or skin whatever you youngs ones call it(yep im an old guy lol) and im stuck on a few things that i hope the builder or someone with the knowledge can assist me in my questions.
ok so i have found a problem regarding the duration of films,each film i have says the same time on each movie,how can i get this sorted and also i have read every page of this thread (few coffees as well!!) the above quote states to change some settings ect but tried looking in folders ect and for the life of me i cant see whre to change them?
another question sometimes when i press on certain add ons to change things like covers clear or colour its very hard to see the txt is this a bug within the build? sometimes they in boxes and there fine?
yep another question!!
how can i get the music to play for my tv programs ect i can play them in that more info about the program and actors and i can see it download but it dont play when i go to tv program what do i need todo as thought it would be setup?
also read about imbd how is that setup as well.....im sorry for the many questions but this build/skin is my cup of tea or in my case coffee!! and want it looking and playing nice
im using a pc with windows 10 if that helps,im willing to learn how to do all this but the tech talk im not understanding if that makes sense.
so if someone could take me under there wing so to speak that will be very greatfull indeed
many thanks
rick
Ps: i have installed all the extra zip files that are at begiining into there corsponding areas so am i right in unzipping each one into there places?