From 69480575e1ffc8f83c27845db3b423a4c76733f5 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 5 Nov 2021 09:57:44 +0100 Subject: [PATCH] Fix Visualizzazioni --- platformcode/keymaptools.py | 2 +- platformcode/platformtools.py | 25 ++++++++++++++++++------- service.py | 6 +++++- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/platformcode/keymaptools.py b/platformcode/keymaptools.py index ac98cfac..57f911c4 100644 --- a/platformcode/keymaptools.py +++ b/platformcode/keymaptools.py @@ -179,7 +179,7 @@ class Main(xbmcgui.WindowXMLDialog): def submenu(self): - itmlist = [] + itemlist = [] channel_name = self.MENU.getSelectedItem().getProperty('channel') focus = int(self.MENU.getSelectedItem().getProperty('focus')) if channel_name == 'channelselector': diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 4fe5d3cc..5fdb150e 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -393,7 +393,10 @@ def viewmodeMonitor(): if get_window() == 'WINDOW_VIDEO_NAV': try: currentModeName = xbmc.getInfoLabel('Container.Viewmode') - win = xbmcgui.Window(xbmcgui.getCurrentWindowId()) + parent_info = xbmc.getInfoLabel('Container.FolderPath') + item_info = xbmc.getInfoLabel('Container.ListItemPosition(2).FileNameAndPath') + parent_item = Item().fromurl(parent_info) + win = xbmcgui.Window(10025) currentMode = int(win.getFocusId()) # logger.debug('CM', currentMode, 'CN',currentModeName, 'label',xbmc.getInfoLabel('Container.FolderPath')) # if not parent_info: @@ -404,7 +407,7 @@ def viewmodeMonitor(): if content: defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1]) if currentMode != defaultMode: - logger.debug('viewmode changed: ' + currentModeName + '-' + str(currentMode) + ' - content: ' + content) + # logger.debug('viewmode changed: ' + currentModeName + '-' + str(currentMode) + ' - content: ' + content) config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode)) dialog_notification(config.get_localized_string(70153), config.get_localized_string(70187) % (content, currentModeName), @@ -415,6 +418,9 @@ def viewmodeMonitor(): def getCurrentView(item=None, parent_item=None): + + if not item: + item = Item() if not parent_item: logger.debug('ESCO') return None, None @@ -450,21 +456,26 @@ def getCurrentView(item=None, parent_item=None): or (item.channel in ['videolibrary'] and parent_item.action in ['list_tvshows']): return 'tvshow', 'tvshows' - elif parent_item.action in ['get_seasons']: - return 'season', 'tvshows' - elif parent_item.action in ['episodios', 'get_episodes'] or item.contentType == 'episode': return 'episode', 'tvshows' - elif parent_item.action in ['getmainlist', '']: + elif parent_item.action in ['get_seasons']: + logger.debug('CONTENTTYPE:',item.contentType) + return 'season', 'tvshows' + + elif parent_item.action in ['getmainlist', '', 'getchanneltypes']: return 'home', addons elif parent_item.action in ['filterchannels']: return 'channels', addons - else: + elif item.action: return 'menu', addons + else: + return None, None + + def set_view_mode(item, parent_item): def reset_view_mode(): diff --git a/service.py b/service.py index 431fa92a..2da0d84b 100644 --- a/service.py +++ b/service.py @@ -318,8 +318,12 @@ def run_threaded(job_func, args): def join_threads(): + logger.debug(threads) for th in threads: - th.join() + try: + th.join() + except: + logger.error(traceback.format_exc()) class AddonMonitor(xbmc.Monitor):