From 72512f9d80970c84d06809826b8931e7a3d5df0e Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Thu, 9 Jan 2020 18:42:08 +0100 Subject: [PATCH 1/2] Fix Episodio Successivo --- specials/nextep.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/specials/nextep.py b/specials/nextep.py index 131e9389..27cd03ec 100644 --- a/specials/nextep.py +++ b/specials/nextep.py @@ -58,11 +58,12 @@ def afther_stop(item): Total = xbmc.Player().getTotalTime() Actual = xbmc.Player().getTime() Difference = Total - Actual - if Total > Actual >= Difference: + if Total > TimeFromEnd >= Difference: play_next = True except: break + # from core.support import dbg; dbg() if play_next: play_next = False season_ep = next_file.split('.')[0] @@ -89,7 +90,8 @@ def afther_stop(item): if nextDialog.stillwatching or nextDialog.continuewatching: xbmc.Player().stop() if normal_window: - sleep(0.5) + sleep(1) + logger.info('BACK STILL') xbmc.executebuiltin('Action(Back)') else: item.no_window = True @@ -97,7 +99,8 @@ def afther_stop(item): play_from_library(item) else: if normal_window: - sleep(0.5) + sleep(1) + logger.info('BACK NOT STILL') xbmc.executebuiltin('Action(Back)') else: item.no_window = True From dd083368653ed847fb0130345b459c4aea04c5e8 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Thu, 9 Jan 2020 20:06:21 +0100 Subject: [PATCH 2/2] Episodio successivo spostato in platformtools: - Funziona in Videoteca di Kod - Permette la ripresa della funzione dopo lo stop --- platformcode/launcher.py | 6 ------ platformcode/platformtools.py | 9 ++++++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 6400628e..9900f786 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -467,9 +467,6 @@ def play_from_library(item): if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1: # Ventana convencional xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")") - if config.get_setting('next_ep') > 0 and item.contentType != 'movie': - from specials.nextep import afther_stop - afther_stop(item) else: # Ventana emergente @@ -535,6 +532,3 @@ def play_from_library(item): if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel): break - if config.get_setting('next_ep') > 0 and item.contentType != 'movie': - from specials.nextep import afther_stop - afther_stop(item) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 3bf20b78..b3ff8dac 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -756,6 +756,9 @@ def play_video(item, strm=False, force_direct=False, autoplay=False): # Reproduce xbmc_player.play(playlist, xlistitem) + if not item.launcher and (strm or item.strm_path) and config.get_setting('next_ep') > 0 and item.contentType != 'movie': + from specials.nextep import afther_stop + afther_stop(item) else: set_player(item, xlistitem, mediaurl, view, strm) @@ -1099,7 +1102,7 @@ def set_player(item, xlistitem, mediaurl, view, strm): download_and_play.download_and_play(mediaurl, "download_and_play.mp4", config.get_setting("downloadpath")) return - elif config.get_setting("player_mode") == 0 or \ + elif config.get_setting("player_mode") == 0 or\ (config.get_setting("player_mode") == 3 and mediaurl.startswith("rtmp")): # Añadimos el listitem a una lista de reproducción (playlist) playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) @@ -1138,6 +1141,10 @@ def set_player(item, xlistitem, mediaurl, view, strm): from platformcode import xbmc_videolibrary xbmc_videolibrary.mark_auto_as_watched(item) + if not item.launcher and (strm or item.strm_path) and config.get_setting('next_ep') > 0 and item.contentType != 'movie': + from specials.nextep import afther_stop + afther_stop(item) + def torrent_client_installed(show_tuple=False): # Plugins externos se encuentra en servers/torrent.json nodo clients