From ca52117c4f702dbda487e324e93f6f23cd25af8c Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 25 Oct 2019 13:41:54 +0200 Subject: [PATCH] Fix resume not working in some cases --- resources/lib/timing.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/resources/lib/timing.py b/resources/lib/timing.py index 818a3629..5ace8a90 100644 --- a/resources/lib/timing.py +++ b/resources/lib/timing.py @@ -63,25 +63,21 @@ def kodi_now(): def millis_to_kodi_time(milliseconds): """ - Converts time in milliseconds to the time dict used by the Kodi JSON RPC: + Converts time in milliseconds [int or float] to the time dict used by the + Kodi JSON RPC: { 'hours': [int], 'minutes': [int], 'seconds'[int], 'milliseconds': [int] } - Pass in the time in milliseconds as an int """ seconds = int(milliseconds / 1000) minutes = int(seconds / 60) - seconds = seconds % 60 - hours = int(minutes / 60) - minutes = minutes % 60 - milliseconds = milliseconds % 1000 - return {'hours': hours, - 'minutes': minutes, - 'seconds': seconds, - 'milliseconds': milliseconds} + return {'hours': int(minutes / 60), + 'minutes': int(minutes % 60), + 'seconds': int(seconds % 60), + 'milliseconds': int(milliseconds % 1000)} def kodi_time_to_millis(time):