2015-04-13, 01:20
(2015-04-07, 16:02)Martijn Wrote: @mkortstiege
imo this should be something that is by default available for skins
+1
Good to see you agree. Hopefully this can be done quickly and easily.
(2015-04-07, 16:02)Martijn Wrote: @mkortstiege
imo this should be something that is by default available for skins
(2015-04-20, 09:18)Mike_Doc Wrote: Hi Twolaw,
My skin solution may no be the best, been away and just started looking at updating other views and can't seem to get it to work. My noob skills are the problem as I just need to figure out how and where to call your script. I'd like to run it for the focused item but I don't think <onfocus> is available. If anyone has a suggestion then please let me know?
Mike
21:06:39 T:139772222650112 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: invalid literal for int() with base 10: ''
Traceback (most recent call last):
File "/storage/.kodi/addons/script.duration-master/default.py", line 77, in <module>
Main()
File "/storage/.kodi/addons/script.duration-master/default.py", line 34, in __init__
self.run_backend()
File "/storage/.kodi/addons/script.duration-master/default.py", line 63, in run_backend
self.display_duration()
File "/storage/.kodi/addons/script.duration-master/default.py", line 72, in display_duration
readable_duration = in_hours_and_min(self.duration)
File "/storage/.kodi/addons/script.duration-master/default.py", line 19, in in_hours_and_min
full_minutes = int(minutes_string)
ValueError: invalid literal for int() with base 10: ''
-->End of Python script error report<--
def in_hours_and_min(minutes_string):
try:
full_minutes = int(minutes_string)
minutes = full_minutes % 60
hours = full_minutes // 60
return str(hours) + 'h' + str(minutes).zfill(2)
except:
return '--h--'
full_minutes = int(minutes_string)
minutes = full_minutes % 60
hours = full_minutes // 60
return str(hours) + 'h' + str(minutes).zfill(2)
full_minutes = int(minutes_string)
minutes = full_minutes % 60
hours = full_minutes // 60
return str(hours) + 'h ' + str(minutes) + 'm'.zfill(1)