From d7e346db0cad446680341e71727bf979992d6966 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 4 Jan 2020 17:39:43 +0100 Subject: [PATCH 1/3] Fix Nascondi server --- platformcode/launcher.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index c611cee0..498bdd73 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -14,6 +14,7 @@ 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 @@ -441,7 +442,7 @@ 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 @@ -468,6 +469,10 @@ 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]) + path = filetools.join(config.get_videolibrary_path(), config.get_setting("folder_tvshows")) # y volvemos a lanzar kodi if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1: @@ -478,9 +483,10 @@ def play_from_library(item): pass while platformtools.is_playing(): pass - sleep(0.1) + sleep(0.5) xbmc.executebuiltin('Action(Back)') + else: # Ventana emergente from specials import videolibrary From 25960521baeab5aa79b5318da5a8ad0d9a4c50b3 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 4 Jan 2020 18:57:00 +0100 Subject: [PATCH 2/3] Test Riproduci Episodio Successivo (Funziona solo da Libreria) --- platformcode/launcher.py | 36 ++++++++++++++++++++++++++++++++---- resources/settings.xml | 1 + 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 498bdd73..3cccb0cd 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -447,14 +447,15 @@ def play_from_library(item): import xbmcgui import xbmcplugin import xbmc - from time import sleep + from time import sleep, time from core import jsontools autoplay_node = jsontools.get_node_from_file('autoplay', 'AUTOPLAY') channel_node = autoplay_node.get(item.channel, {}) settings_node = channel_node.get('settings', {}) - AP = config.get_setting('autoplay') or settings_node['active'] + AP = config.get_setting('autoplay') or settings_node.has_key('active') APS = config.get_setting('autoplay_server_list') + NE = config.get_setting('autoplay_next') # Intentamos reproducir una imagen (esto no hace nada y ademas no da error) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, @@ -478,7 +479,35 @@ 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 AP and APS: + if AP and NE: + while not platformtools.is_playing(): + pass + while platformtools.is_playing(): + pass + sleep(0.5) + counter = time() + play_next = False + if platformtools.dialog_yesno('Prossimo Episodio?', '', nolabel="Sì", yeslabel="No", autoclose=5000) == 0: + 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) + 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 + logger.info(str(item)) + play_from_library(item) + elif os.path.isfile(item.strm_path.replace(path+'%dx%2d' % (season, episode),'%dx%2d' % (season+1, 1))): + 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 + logger.info(str(item)) + play_from_library(item) + + elif AP and APS: while not platformtools.is_playing(): pass while platformtools.is_playing(): @@ -486,7 +515,6 @@ def play_from_library(item): sleep(0.5) xbmc.executebuiltin('Action(Back)') - else: # Ventana emergente from specials import videolibrary diff --git a/resources/settings.xml b/resources/settings.xml index 5b2adf9e..a91e3494 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -5,6 +5,7 @@ + From 87dc6b6ac6625a18f4666c8138176e0b57e27ee5 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sun, 5 Jan 2020 14:12:16 +0100 Subject: [PATCH 3/3] Piccolo fix Episodio successivo (Funziona solo con autoplay globale) --- platformcode/launcher.py | 48 +++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 3cccb0cd..d7e8fc92 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -450,10 +450,8 @@ def play_from_library(item): from time import sleep, time from core import jsontools - autoplay_node = jsontools.get_node_from_file('autoplay', 'AUTOPLAY') - channel_node = autoplay_node.get(item.channel, {}) - settings_node = channel_node.get('settings', {}) - AP = config.get_setting('autoplay') or settings_node.has_key('active') + 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') @@ -473,7 +471,7 @@ def play_from_library(item): episodes = scrapertools.find_single_match(item.strm_path, '(\d+)x(\d+)') season = int(episodes[0]) episode = int(episodes[1]) - path = filetools.join(config.get_videolibrary_path(), config.get_setting("folder_tvshows")) + # y volvemos a lanzar kodi if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1: @@ -485,27 +483,27 @@ def play_from_library(item): while platformtools.is_playing(): pass sleep(0.5) - counter = time() + 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 platformtools.dialog_yesno('Prossimo Episodio?', '', nolabel="Sì", yeslabel="No", autoclose=5000) == 0: - 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) - 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 - logger.info(str(item)) - play_from_library(item) - elif os.path.isfile(item.strm_path.replace(path+'%dx%2d' % (season, episode),'%dx%2d' % (season+1, 1))): - 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 - logger.info(str(item)) - play_from_library(item) + 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():