From ac2edfd117dceeb57f303f0d17331adab8357caa Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Wed, 8 Jan 2020 20:38:22 +0100 Subject: [PATCH] Fix Launcher --- platformcode/launcher.py | 56 ++++------------------------------------ 1 file changed, 5 insertions(+), 51 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 1a53acc0..c28b32b3 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -14,7 +14,6 @@ from core import scrapertools from core import servertools from core import trakt_tools from core import videolibrarytools -from core import filetools from core.item import Item from platformcode import config, logger from platformcode import platformtools @@ -39,7 +38,7 @@ def start(): from specials import resolverdns from specials.checkhost import test_conn import threading - threading.Thread(target=test_conn, args=(True, False, True, [], [], True)).start() + threading.Thread(target=test_conn, args=(True, True, True, [], [], True)).start() # check_adsl = test_conn(is_exit = True, check_dns = True, view_msg = True, # lst_urls = [], lst_site_check_dns = [], in_addon = True) @@ -430,7 +429,6 @@ def limit_itemlist(itemlist): def play_from_library(item): - itemlist=[] """ Los .strm al reproducirlos desde kodi, este espera que sea un archivo "reproducible" asi que no puede contener más items, como mucho se puede colocar un dialogo de seleccion. @@ -442,18 +440,12 @@ def play_from_library(item): @param item: elemento con información """ logger.info() - logger.debug("item: \n" + item.tostring('\n')) + #logger.debug("item: \n" + item.tostring('\n')) import xbmcgui import xbmcplugin import xbmc - from time import sleep, time - - from core import jsontools - path = filetools.join(config.get_videolibrary_path(), config.get_setting("folder_tvshows")) - AP = config.get_setting('autoplay') - APS = config.get_setting('autoplay_server_list') - NE = config.get_setting('autoplay_next') + from time import sleep # Intentamos reproducir una imagen (esto no hace nada y ademas no da error) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, @@ -468,50 +460,11 @@ def play_from_library(item): item.action = "findvideos" window_type = config.get_setting("window_type", "videolibrary") - episodes = scrapertools.find_single_match(item.strm_path, '(\d+)x(\d+)') - season = int(episodes[0]) - episode = int(episodes[1]) - # y volvemos a lanzar kodi if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1: # Ventana convencional xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")") - if AP and NE: - while not platformtools.is_playing(): - pass - while platformtools.is_playing(): - pass - sleep(0.5) - xbmc.executebuiltin('Action(Back)') - ep = '%dx%02d' % (season, episode) - next_ep = '%dx%02d' % (season, episode+1) - next_season = '%dx%02d' % (season+1, 1) - next_ep_path = item.strm_path.replace(ep,next_ep) - next_season_path = item.strm_path.replace(ep,next_ep) - play_next = False - if os.path.isfile(path+next_ep_path): - item.contentEpisodeNumber = item.infoLabels['episode'] = episode+1 - item.contentTitle = item.infoLabels['title'] = next_ep - item.strm_path = next_ep_path - play_next = True - elif os.path.isfile(path+next_season_path): - item.contentSeason = item.infoLabels['season'] = season+1 - item.contentEpisodeNumber = item.infoLabels['episode'] = 1 - item.contentTitle = item.infoLabels['title'] = next_season - item.strm_path = next_season_path - play = True - - if play_next == True and platformtools.dialog_yesno('Prossimo Episodio?', item.contentTitle, nolabel="Sì", yeslabel="No", autoclose=5000) == 0: - play_from_library(item) - - elif AP and APS: - while not platformtools.is_playing(): - pass - while platformtools.is_playing(): - pass - sleep(0.5) - xbmc.executebuiltin('Action(Back)') else: # Ventana emergente @@ -540,8 +493,9 @@ def play_from_library(item): itemlist = reorder_itemlist(itemlist) + import time p_dialog.update(100, '') - sleep(0.5) + time.sleep(0.5) p_dialog.close()