From 08eb1784108285894718cdd97276d48dc90f616c Mon Sep 17 00:00:00 2001 From: enricodarodda <57716112+enricodarodda@users.noreply.github.com> Date: Mon, 25 Sep 2023 21:59:16 +0200 Subject: [PATCH] Fix Resume Playback Function Updated platformtools.py fixing "resume_playback" function when the Skin Resume Menu is set. In particular, the function now matches correctly the selected option of the dialog with the corresponding action triggered. --- platformcode/platformtools.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index bbb637af..b1629162 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1655,7 +1655,7 @@ def resume_playback(played_time): if played_time and played_time > 30: - if config.get_setting('resume_menu') == 0: + if config.get_setting('resume_menu') == 0: # Resume Menu matches Custom Theme Dialog = ResumePlayback('ResumePlayback.xml', config.get_runtime_path(), played_time=played_time) Dialog.show() t = 0 @@ -1663,7 +1663,7 @@ def resume_playback(played_time): t += 1 xbmc.sleep(100) if not Dialog.Resume: played_time = 0 - else: + else: # Resume Menu matches Skin Theme m, s = divmod(played_time, 60) h, m = divmod(m, 60) idx = xbmcgui.Dialog().contextmenu( @@ -1671,7 +1671,10 @@ def resume_playback(played_time): xbmc.getLocalizedString(12022).format('%02d:%02d:%02d' % (h, m, s)), xbmc.getLocalizedString(12021) ]) - if idx in [-1, 0]: played_time = 0 + # if the dialog is skipped (idx == -1) + # or the second item is selected (idx == 1) + # resume from the beginning + if idx in [-1, 1]: played_time = 0 else: played_time = 0 xbmc.sleep(300)