diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 4bacfdeb..bbde544d 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1348,7 +1348,7 @@ def set_player(item, xlistitem, mediaurl, view, strm): logger.info("mediaurl=" + mediaurl) if player_mode in [0,1]: - prevent_busy(item) + # prevent_busy(item) if player_mode in [1]: item.played_time = resume_playback(get_played_time(item)) @@ -1449,7 +1449,7 @@ def play_torrent(item, xlistitem, mediaurl): selection = 0 if selection >= 0: - prevent_busy(item) + # prevent_busy(item) mediaurl = urllib.quote_plus(item.url) torr_client = torrent_options[selection][0] @@ -1777,12 +1777,14 @@ def set_played_time(item): def prevent_busy(item): logger.debug() - if not item.autoplay and not item.window: - if item.action == 'play_from_library': xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) - else: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) + # from core.support import dbg;dbg() + if not item.autoplay and not item.window and item.action == 'play_from_library': + xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) + # else: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) # first wait the fake video to start - while not is_playing(): - xbmc.sleep(10) + # while not is_playing(): + # logger.debug('wait for play') + # pass # then wait a little more xbmc.sleep(200) # and then stop it diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index 43222a83..1f827cf5 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -26,11 +26,10 @@ def mark_auto_as_watched(item): actual_time = 0 total_time = 0 - time_limit = time.time() + 30 + time_limit = time.time() + 10 while not platformtools.is_playing() and time.time() < time_limit: time.sleep(1) - marked = False sync = False next_episode = None @@ -38,6 +37,7 @@ def mark_auto_as_watched(item): percentage = float(config.get_setting("watched_setting")) / 100 time_from_end = config.get_setting('next_ep_seconds') + if item.contentType != 'movie' and 0 < config.get_setting('next_ep') < 3: next_dialogs = ['NextDialog.xml', 'NextDialogExtended.xml', 'NextDialogCompact.xml'] next_ep_type = config.get_setting('next_ep_type') @@ -46,7 +46,8 @@ def mark_auto_as_watched(item): except: next_episode = False logger.debug(next_episode) - while platformtools.is_playing(): + while not xbmc.Monitor().abortRequested(): + if not platformtools.is_playing(): break try: actual_time = xbmc.Player().getTime() except: pass try: total_time = xbmc.Player().getTotalTime()