[Release] Duration script - Display movies runtime in hours & minutes
#31
Question 
(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.

Image

2h35 is easier to understand than 155, right ?
Image

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. Blush
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 Confused
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?
Reply
#32
Are you able to add it to work with movie sets?
Aussie, Aussie, Aussie, Oi, Oi, Oi

Don't forget the Thank User button if i have helped!
|
V
Reply
#33
(2015-09-22, 10:58)rick75 Wrote: 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 Confused
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?

Hi rick this is a addon for skinners. You need to edit the skin you are using to use this addon. You other questions need to be asked in the other forums . TV tunes settings are in addon settings.
Aussie, Aussie, Aussie, Oi, Oi, Oi

Don't forget the Thank User button if i have helped!
|
V
Reply
#34
Is this addon dead? If people come here looking to change total mins to hours and mins. go try script skin helper has this option plus many more.
Aussie, Aussie, Aussie, Oi, Oi, Oi

Don't forget the Thank User button if i have helped!
|
V
Reply
#35
For any one else looking for tbis sort of addon have a look at Script.SkinHelper.Service.
Just google kodi skin helper and there you go Nod
Aussie, Aussie, Aussie, Oi, Oi, Oi

Don't forget the Thank User button if i have helped!
|
V
Reply
#36
Where are the settings for duration in that script?
YOYIZDERZOMENEMOHOZEZAZEZDENDERIZHOZEZ
Reply
#37
There is no settings. Please read from start and explains how to modify the script.
Aussie, Aussie, Aussie, Oi, Oi, Oi

Don't forget the Thank User button if i have helped!
|
V
Reply
#38
(2015-10-10, 07:26)Rjsachse Wrote: For any one else looking for tbis sort of addon have a look at Script.SkinHelper.Service.
Just google kodi skin helper and there you go Nod

Hi Rjsachse

thanks for the advice WinkI will try to add this feature (Display movies runtime in hours & minutes) in the Aeon Mq6 theme
Nod
Reply
#39
Great addon! This should be an option in Kodi to begin with.
Asrock Rog Z390-H | Intel i9 9900K | Windows 10 Pro x64 | Pop!_OS 20.10 |Nvidia Shield TV Pro (2019)
EVGA Hybrid FTW GTX 1070 | Corsair 16GB DDR4
Samsung 500GB SSD | 500GB Nvme SSD |500GB WD Black Nvme SSD |6TB HDD
Reply
#40
whats the name of the skin and view type used in the screenshot?
Reply
#41
I'm so confused with this...

(2015-03-08, 23:05)twolaw Wrote: 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 seems to be speaking about a very specific skin. None of this apply to me. Only 1 out of 3 of those elements are on my Variables.xml file, and my DialogVideoInfo.xml does not contain the line mentioned.

Could anyone tell me what changes need to be made? I tried but the further I got was Kodi crashing.
Reply
#42
for me it doesn't work and right after installation it says it has updates but the addon isn't updated in two years.
I tried skin helper with this, but the result is the same. nothing appears. I'm on kodi v17
PHP Code:
<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
Reply
#43
I reworked the duration script to a (imho) now better working version for KODI 17 (Krypton):

You find it in my repo:
https://github.com/axbmcuser/_repo/raw/m...mcuser.zip

script.duration_axbmcuser (v0.3.5 at the moment)


After installing the enabled addon runs as service in the background. You don't need Runscript(xxx) stuff anymore.

See addon description in Addon Manager after installation for Details on how to use the Properties.
⬅️⬅️ Feel free to leave a 👍 on useful posts  |  A Confluence ZEITGEIST (A modern reimagination of Confluence)  |  axbmcuser REPO (Download Link)  |  Kodi 17.7 DSPlayer x64 BETTERGUI (2020 build)
Reply
#44
(2017-07-14, 22:10)axbmcuser Wrote: I reworked the duration script to a (imho) now better working version for KODI 17 (Krypton):

You find it in my repo:
https://github.com/axbmcuser/_repo/raw/m...mcuser.zip

script.duration_axbmcuser (v0.3.5 at the moment)


After installing the enabled addon runs as service in the background. You don't need Runscript(xxx) stuff anymore.

See addon description in Addon Manager after installation for Details on how to use the Properties.

Hello,
Could explain how to install your script for my MOD
Because I can not install it.
What changes need to be made

cordially
Reply
#45
(2017-07-14, 22:10)axbmcuser Wrote: I reworked the duration script to a (imho) now better working version for KODI 17 (Krypton):

You find it in my repo:
https://github.com/axbmcuser/_repo/raw/m...mcuser.zip

script.duration_axbmcuser (v0.3.5 at the moment)


After installing the enabled addon runs as service in the background. You don't need Runscript(xxx) stuff anymore.

See addon description in Addon Manager after installation for Details on how to use the Properties.
 Nice job !
I didn't have time to update, i now put a link to your code on first post.
Reply

Logout Mark Read Team Forum Stats Members Help
[Release] Duration script - Display movies runtime in hours & minutes1