Prova viste

This commit is contained in:
marco
2021-12-28 19:37:01 +01:00
parent 9cc3ab7f52
commit edecfb8df4
+20 -19
View File
@@ -432,20 +432,22 @@ def viewmodeMonitor():
parent_info = xbmc.getInfoLabel('Container.FolderPath') parent_info = xbmc.getInfoLabel('Container.FolderPath')
parent = Item().fromurl(parent_info) parent = Item().fromurl(parent_info)
if 'plugin.video.kod' in parent_info: if 'plugin.video.kod' in parent_info:
item = Item().fromurl(xbmc.getInfoLabel('Container.ListItemPosition(2).FileNameAndPath')) first_item_url = xbmc.getInfoLabel('Container.ListItemAbsolute(1).FileNameAndPath')
currentModeName = xbmc.getInfoLabel('Container.Viewmode') if first_item_url:
currentMode = int(xbmcgui.Window(10025).getFocusId()) item = Item().fromurl(first_item_url)
# logger.debug('SAVE VIEW 1', currentMode, parent.action, item.action) currentModeName = xbmc.getInfoLabel('Container.Viewmode')
if 50 <= currentMode < 600 and parent.action != item.action: currentMode = int(xbmcgui.Window(10025).getFocusId())
content, Type = getCurrentView(item, parent) # logger.debug('SAVE VIEW 1', currentMode, parent.action, item.action)
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1]) if 50 <= currentMode < 600 and parent.action != item.action:
if content and currentMode != defaultMode: content, Type = getCurrentView(item, parent)
config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode)) defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
# logger.debug('SAVE VIEW 2', defaultMode, '->', currentMode) if content and currentMode != defaultMode:
if config.get_setting('viewchange_notify'): config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
dialog_notification(config.get_localized_string(70153), # logger.debug('SAVE VIEW 2', defaultMode, '->', currentMode)
config.get_localized_string(70187) % (content, currentModeName), if config.get_setting('viewchange_notify'):
sound=False) dialog_notification(config.get_localized_string(70153),
config.get_localized_string(70187) % (content, currentModeName),
sound=False)
except: except:
import traceback import traceback
@@ -453,12 +455,11 @@ def viewmodeMonitor():
def getCurrentView(item=None, parent_item=None): def getCurrentView(item=None, parent_item=None):
if not item: if not item:
item = Item() item = Item()
if not parent_item: # if not parent_item:
logger.debug('ESCO') # logger.debug('ESCO')
return None, None # return None, None
parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search'] parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search']
@@ -490,7 +491,7 @@ def getCurrentView(item=None, parent_item=None):
return 'season', 'tvshows' return 'season', 'tvshows'
elif parent_item.action in ['getmainlist', '', 'getchanneltypes']: elif parent_item.action in ['getmainlist', '', 'getchanneltypes']:
return None, None return 'home', addons
elif parent_item.action in ['filterchannels']: elif parent_item.action in ['filterchannels']:
return 'channels', addons return 'channels', addons