From 4a3557c3aba152188facd8e78dbe34264112920f Mon Sep 17 00:00:00 2001 From: Maven85 Date: Fri, 21 Feb 2020 11:16:31 +0100 Subject: [PATCH] Document and fix a known Kodi bug in Up Next This reimplements a bugfix from Maven85 and documents the case. --- resources/lib/utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 59684a56..633a7b33 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -149,5 +149,13 @@ def localize(string_id): def localize_time(time): """Localize time format""" - time_format = getRegion('time').replace(':%S', '') # Strip off seconds + time_format = getRegion('time') + + # Fix a bug in Kodi v18.5 and older causing double hours + # https://github.com/xbmc/xbmc/pull/17380 + time_format = time_format.replace('%H%H:', '%H:') + + # Strip off seconds + time_format = time_format.replace(':%S', '') + return time.strftime(time_format)