Nuova gestione salvataggio Viste (Senza Monitor)
This commit is contained in:
@@ -315,6 +315,7 @@ def render_items(itemlist, parent_item):
|
|||||||
return
|
return
|
||||||
|
|
||||||
logger.debug('START render_items')
|
logger.debug('START render_items')
|
||||||
|
save_view_mode()
|
||||||
thumb_type = config.get_setting('video_thumbnail_type')
|
thumb_type = config.get_setting('video_thumbnail_type')
|
||||||
from platformcode import shortcuts
|
from platformcode import shortcuts
|
||||||
# from core import httptools
|
# from core import httptools
|
||||||
@@ -389,28 +390,28 @@ def render_items(itemlist, parent_item):
|
|||||||
logger.debug('END render_items')
|
logger.debug('END render_items')
|
||||||
|
|
||||||
|
|
||||||
def viewmodeMonitor():
|
# def viewmodeMonitor():
|
||||||
logger.debug('WINDOW:',get_window(), xbmcgui.getCurrentWindowId())
|
# logger.debug('WINDOW:',get_window(), xbmcgui.getCurrentWindowId())
|
||||||
if get_window() == 'WINDOW_VIDEO_NAV':
|
# if get_window() == 'WINDOW_VIDEO_NAV':
|
||||||
try:
|
# try:
|
||||||
currentMode = int(xbmcgui.Window(10025).getFocusId())
|
# currentMode = int(xbmcgui.Window(10025).getFocusId())
|
||||||
if 50 <= currentMode < 600:
|
# if 50 <= currentMode < 600:
|
||||||
currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
# currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
||||||
parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
# parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
||||||
item_info = xbmc.getInfoLabel('Container.ListItemPosition(1).FileNameAndPath')
|
# item_info = xbmc.getInfoLabel('Container.ListItemPosition(1).FileNameAndPath')
|
||||||
if currentModeName and 'plugin.video.kod' in parent_info:
|
# if currentModeName and 'plugin.video.kod' in parent_info:
|
||||||
content, Type = getCurrentView(Item().fromurl(item_info) if item_info else Item(), Item().fromurl(parent_info))
|
# content, Type = getCurrentView(Item().fromurl(item_info) if item_info else Item(), Item().fromurl(parent_info))
|
||||||
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
# defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||||
if content and currentMode != defaultMode and int(xbmcgui.Window(10025).getFocusId()) == currentMode:
|
# if content and currentMode != defaultMode and int(xbmcgui.Window(10025).getFocusId()) == currentMode:
|
||||||
config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
|
# config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
|
||||||
if config.get_setting('viewchange_notify'):
|
# if config.get_setting('viewchange_notify'):
|
||||||
dialog_notification(config.get_localized_string(70153),
|
# dialog_notification(config.get_localized_string(70153),
|
||||||
config.get_localized_string(70187) % (content, currentModeName),
|
# config.get_localized_string(70187) % (content, currentModeName),
|
||||||
sound=False)
|
# sound=False)
|
||||||
|
|
||||||
except:
|
# except:
|
||||||
import traceback
|
# import traceback
|
||||||
logger.error(traceback.print_exc())
|
# logger.error(traceback.print_exc())
|
||||||
|
|
||||||
|
|
||||||
def getCurrentView(item=None, parent_item=None):
|
def getCurrentView(item=None, parent_item=None):
|
||||||
@@ -421,21 +422,10 @@ def getCurrentView(item=None, parent_item=None):
|
|||||||
logger.debug('ESCO')
|
logger.debug('ESCO')
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
# if not parent_item:
|
|
||||||
# info = xbmc.getInfoLabel('Container.FolderPath')
|
|
||||||
# if not info:
|
|
||||||
# return None, None
|
|
||||||
# parent_item = Item().fromurl(info)
|
|
||||||
# if not item:
|
|
||||||
# info = xbmc.getInfoLabel('Container.ListItemPosition(2).FileNameAndPath') # first addon listitem (consider "..")
|
|
||||||
# if not info:
|
|
||||||
# item = Item()
|
|
||||||
# else:
|
|
||||||
# item = Item().fromurl(info) if info else Item()
|
|
||||||
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']
|
||||||
|
|
||||||
addons = 'addons' if config.get_setting('touch_view') else ''
|
addons = 'addons' if config.get_setting('touch_view') else ''
|
||||||
# from core.support import dbg;dbg()
|
|
||||||
if parent_item.action == 'findvideos' or (parent_item.action in ['channel_search', 'new_search'] and parent_item.infoLabels['tmdb_id']):
|
if parent_item.action == 'findvideos' or (parent_item.action in ['channel_search', 'new_search'] and parent_item.infoLabels['tmdb_id']):
|
||||||
return 'server', addons
|
return 'server', addons
|
||||||
|
|
||||||
@@ -462,7 +452,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 'home', addons
|
return None, None
|
||||||
|
|
||||||
elif parent_item.action in ['filterchannels']:
|
elif parent_item.action in ['filterchannels']:
|
||||||
return 'channels', addons
|
return 'channels', addons
|
||||||
@@ -474,6 +464,23 @@ def getCurrentView(item=None, parent_item=None):
|
|||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
|
|
||||||
|
def save_view_mode():
|
||||||
|
if get_window() == 'WINDOW_VIDEO_NAV':
|
||||||
|
currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
||||||
|
currentMode = int(xbmcgui.Window(10025).getFocusId())
|
||||||
|
parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
||||||
|
item_info = xbmc.getInfoLabel('ListItem.FileNameAndPath')
|
||||||
|
content, Type = getCurrentView(Item().fromurl(item_info) if item_info else Item(), Item().fromurl(parent_info))
|
||||||
|
|
||||||
|
if content:
|
||||||
|
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||||
|
if currentMode != defaultMode:
|
||||||
|
config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
|
||||||
|
if config.get_setting('viewchange_notify'):
|
||||||
|
dialog_notification(config.get_localized_string(70153),
|
||||||
|
config.get_localized_string(70187) % (content, currentModeName),
|
||||||
|
sound=False)
|
||||||
|
|
||||||
|
|
||||||
def set_view_mode(item, parent_item):
|
def set_view_mode(item, parent_item):
|
||||||
def reset_view_mode():
|
def reset_view_mode():
|
||||||
|
|||||||
+1
-1
@@ -441,7 +441,7 @@ class AddonMonitor(xbmc.Monitor):
|
|||||||
logger.debug('scheduled videolibrary at ' + str(self.update_hour).zfill(2) + ':00')
|
logger.debug('scheduled videolibrary at ' + str(self.update_hour).zfill(2) + ':00')
|
||||||
|
|
||||||
def scheduleScreenOnJobs(self):
|
def scheduleScreenOnJobs(self):
|
||||||
schedule.every(0.5).seconds.do(platformtools.viewmodeMonitor).tag('screenOn')
|
# schedule.every().second.do(platformtools.viewmodeMonitor).tag('screenOn')
|
||||||
schedule.every().second.do(torrent.elementum_monitor).tag('screenOn')
|
schedule.every().second.do(torrent.elementum_monitor).tag('screenOn')
|
||||||
|
|
||||||
def onDPMSActivated(self):
|
def onDPMSActivated(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user