From 7aaed87dfeddc3eaa474c40c21bfbb55b0729940 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 19 Mar 2021 18:37:09 +0100 Subject: [PATCH] Fix mark_as_watched_subThread --- platformcode/platformtools.py | 3 ++- platformcode/xbmc_videolibrary.py | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 1c897767..ffd411a9 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1234,7 +1234,8 @@ def resume_playback(played_time): if action in self.action_exitkeys_id: self.set_values(False) self.close() - if played_time: + + if played_time and played_time > 30: Dialog = ResumePlayback('ResumePlayback.xml', config.get_runtime_path(), played_time=played_time) Dialog.show() t = 0 diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index 9f33ad59..e926caea 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -25,8 +25,6 @@ def mark_auto_as_watched(item): logger.debug() actual_time = 0 total_time = 0 - # logger.debug("item:\n" + item.tostring('\n')) - # if item.options['continue']: item.played_time = platformtools.resume_playback(platformtools.get_played_time(item)) time_limit = time.time() + 30 while not platformtools.is_playing() and time.time() < time_limit: @@ -49,9 +47,10 @@ def mark_auto_as_watched(item): logger.debug(next_episode) while platformtools.is_playing(): - xbmc.sleep(1000) - actual_time = xbmc.Player().getTime() - total_time = xbmc.Player().getTotalTime() + try: actual_time = xbmc.Player().getTime() + except: pass + try: total_time = xbmc.Player().getTotalTime() + except: pass if item.played_time and xbmcgui.getCurrentWindowId() == 12005: xbmc.Player().seekTime(item.played_time) item.played_time = 0 # Fix for Slow Devices @@ -86,7 +85,7 @@ def mark_auto_as_watched(item): break # if item.options['continue']: - if 10 < actual_time < mark_time: + if actual_time < mark_time: item.played_time = actual_time else: item.played_time = 0 platformtools.set_played_time(item)