- Aggiunta Visualizzazione musicvideo
- Doppio controllo cambio di visuale
This commit is contained in:
@@ -41,6 +41,10 @@ def peliculas(item):
|
||||
patron= r'<img src="[^"]+" alt="(?P<title>[^"]+)" data-echo="(?P<thumb>[^"]+)"(?:[^>]+>){7}<a href="(?P<url>[^"]+)"'
|
||||
patronNext = r'<a href="([^"]+)">(?:»|»)'
|
||||
typeContentDict = {'': 'music'}
|
||||
def itemHook(item):
|
||||
item.contentType = 'music'
|
||||
item.thumbnail = item.thumbnail.replace('https:','http:')
|
||||
return item
|
||||
return locals()
|
||||
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ def render_items(itemlist, parent_item):
|
||||
listitem.addContextMenuItems(context_commands)
|
||||
|
||||
dirItems.append(('%s?%s' % (sys.argv[0], item_url), listitem, item.folder))
|
||||
|
||||
# from core.support import dbg;dbg()
|
||||
|
||||
xbmcplugin.addDirectoryItems(_handle, dirItems)
|
||||
|
||||
@@ -390,29 +390,24 @@ def render_items(itemlist, parent_item):
|
||||
|
||||
|
||||
def viewmodeMonitor():
|
||||
# logger.debug('WINDOW:',get_window())
|
||||
logger.debug('WINDOW:',get_window(), xbmcgui.getCurrentWindowId())
|
||||
if get_window() == 'WINDOW_VIDEO_NAV':
|
||||
try:
|
||||
currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
||||
parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
||||
item_info = xbmc.getInfoLabel('Container.ListItemPosition(2).FileNameAndPath')
|
||||
win = xbmcgui.Window(10025)
|
||||
currentMode = int(win.getFocusId())
|
||||
# logger.debug('CM', currentMode, 'CN',currentModeName, 'label',xbmc.getInfoLabel('Container.FolderPath'))
|
||||
# if not parent_info:
|
||||
|
||||
if currentModeName and 'plugin.video.kod' in parent_info and 50 <= currentMode < 1000:# and currentMode >= 50: # inside addon and in itemlist view
|
||||
# logger.debug('CAMBIO VISUALE')
|
||||
content, Type = getCurrentView(Item().fromurl(item_info) if item_info else Item(), Item().fromurl(parent_info))
|
||||
if content:
|
||||
currentMode = int(xbmcgui.Window(10025).getFocusId())
|
||||
if 50 <= currentMode < 600:
|
||||
currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
||||
parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
||||
item_info = xbmc.getInfoLabel('Container.ListItemPosition(1).FileNameAndPath')
|
||||
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))
|
||||
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||
if currentMode != defaultMode:
|
||||
# logger.debug('viewmode changed: ' + currentModeName + '-' + str(currentMode) + ' - content: ' + content)
|
||||
if content and currentMode != defaultMode and int(xbmcgui.Window(10025).getFocusId()) == currentMode:
|
||||
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)
|
||||
|
||||
except:
|
||||
import traceback
|
||||
logger.error(traceback.print_exc())
|
||||
@@ -447,6 +442,9 @@ def getCurrentView(item=None, parent_item=None):
|
||||
elif parent_item.action == 'mainlist':
|
||||
return 'channel', addons
|
||||
|
||||
elif item.contentType == 'music':
|
||||
return 'musicvideo', 'musicvideos'
|
||||
|
||||
elif (item.contentType in ['movie'] and parent_item.action in parent_actions) \
|
||||
or (item.channel in ['videolibrary'] and parent_item.action in ['list_movies']) \
|
||||
or (parent_item.channel in ['favorites'] and parent_item.action in ['mainlist']) \
|
||||
@@ -461,7 +459,6 @@ def getCurrentView(item=None, parent_item=None):
|
||||
return 'episode', 'tvshows'
|
||||
|
||||
elif parent_item.action in ['get_seasons']:
|
||||
logger.debug('CONTENTTYPE:',item.contentType)
|
||||
return 'season', 'tvshows'
|
||||
|
||||
elif parent_item.action in ['getmainlist', '', 'getchanneltypes']:
|
||||
|
||||
@@ -148,6 +148,7 @@
|
||||
<setting id="view_mode_season" type="action" label="30140" default= "Default, 0" visible="false"/>
|
||||
<setting id="view_mode_episode" type="action" label="70362" default= "Default, 0" visible="false"/>
|
||||
<setting id="view_mode_server" type="action" label="70145" default= "Default, 0" visible="false"/>
|
||||
<setting id="view_mode_musicvideo" type="action" label="70145" default= "Default, 0" visible="false"/>
|
||||
<!-- Contextual -->
|
||||
<setting label="30024" type="lsep"/>
|
||||
<setting id="quick_menu" type="bool" label="60360" default="true"/>
|
||||
|
||||
@@ -441,7 +441,7 @@ class AddonMonitor(xbmc.Monitor):
|
||||
logger.debug('scheduled videolibrary at ' + str(self.update_hour).zfill(2) + ':00')
|
||||
|
||||
def scheduleScreenOnJobs(self):
|
||||
schedule.every().second.do(platformtools.viewmodeMonitor).tag('screenOn')
|
||||
schedule.every(0.5).seconds.do(platformtools.viewmodeMonitor).tag('screenOn')
|
||||
schedule.every().second.do(torrent.elementum_monitor).tag('screenOn')
|
||||
|
||||
def onDPMSActivated(self):
|
||||
|
||||
Reference in New Issue
Block a user