Fix Riproduzione

This commit is contained in:
Alhaziel01
2021-08-24 11:21:19 +02:00
parent 5795116630
commit 01d40a66ae
3 changed files with 8 additions and 11 deletions

View File

@@ -1776,12 +1776,7 @@ 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"))
# first wait the fake video to start
while not is_playing():
xbmc.sleep(10)
# then wait a little more
if item.globalsearch: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))
else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
xbmc.sleep(200)
# and then stop it
xbmc.Player().stop()

View File

@@ -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()
@@ -113,6 +114,7 @@ def mark_auto_as_watched(item):
threading.Thread(target=mark_as_watched_subThread, args=[item]).start()
def sync_trakt_addon(path_folder):
"""
Updates the values of episodes seen if

View File

@@ -789,7 +789,7 @@ class SearchWindow(xbmcgui.WindowXML):
def play(self, server=None):
server.globalsearch = True
platformtools.prevent_busy(server)
server.window = True
server.globalsearch = True
return run(server)