- 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>[^"]+)"'
|
patron= r'<img src="[^"]+" alt="(?P<title>[^"]+)" data-echo="(?P<thumb>[^"]+)"(?:[^>]+>){7}<a href="(?P<url>[^"]+)"'
|
||||||
patronNext = r'<a href="([^"]+)">(?:»|»)'
|
patronNext = r'<a href="([^"]+)">(?:»|»)'
|
||||||
typeContentDict = {'': 'music'}
|
typeContentDict = {'': 'music'}
|
||||||
|
def itemHook(item):
|
||||||
|
item.contentType = 'music'
|
||||||
|
item.thumbnail = item.thumbnail.replace('https:','http:')
|
||||||
|
return item
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ def render_items(itemlist, parent_item):
|
|||||||
listitem.addContextMenuItems(context_commands)
|
listitem.addContextMenuItems(context_commands)
|
||||||
|
|
||||||
dirItems.append(('%s?%s' % (sys.argv[0], item_url), listitem, item.folder))
|
dirItems.append(('%s?%s' % (sys.argv[0], item_url), listitem, item.folder))
|
||||||
|
# from core.support import dbg;dbg()
|
||||||
|
|
||||||
xbmcplugin.addDirectoryItems(_handle, dirItems)
|
xbmcplugin.addDirectoryItems(_handle, dirItems)
|
||||||
|
|
||||||
@@ -390,29 +390,24 @@ def render_items(itemlist, parent_item):
|
|||||||
|
|
||||||
|
|
||||||
def viewmodeMonitor():
|
def viewmodeMonitor():
|
||||||
# logger.debug('WINDOW:',get_window())
|
logger.debug('WINDOW:',get_window(), xbmcgui.getCurrentWindowId())
|
||||||
if get_window() == 'WINDOW_VIDEO_NAV':
|
if get_window() == 'WINDOW_VIDEO_NAV':
|
||||||
try:
|
try:
|
||||||
currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
currentMode = int(xbmcgui.Window(10025).getFocusId())
|
||||||
parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
if 50 <= currentMode < 600:
|
||||||
item_info = xbmc.getInfoLabel('Container.ListItemPosition(2).FileNameAndPath')
|
currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
||||||
win = xbmcgui.Window(10025)
|
parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
||||||
currentMode = int(win.getFocusId())
|
item_info = xbmc.getInfoLabel('Container.ListItemPosition(1).FileNameAndPath')
|
||||||
# logger.debug('CM', currentMode, 'CN',currentModeName, 'label',xbmc.getInfoLabel('Container.FolderPath'))
|
if currentModeName and 'plugin.video.kod' in parent_info:
|
||||||
# if not parent_info:
|
content, Type = getCurrentView(Item().fromurl(item_info) if item_info else Item(), Item().fromurl(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:
|
|
||||||
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||||
if currentMode != defaultMode:
|
if content and currentMode != defaultMode and int(xbmcgui.Window(10025).getFocusId()) == currentMode:
|
||||||
# logger.debug('viewmode changed: ' + currentModeName + '-' + str(currentMode) + ' - content: ' + content)
|
|
||||||
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())
|
||||||
@@ -447,6 +442,9 @@ def getCurrentView(item=None, parent_item=None):
|
|||||||
elif parent_item.action == 'mainlist':
|
elif parent_item.action == 'mainlist':
|
||||||
return 'channel', addons
|
return 'channel', addons
|
||||||
|
|
||||||
|
elif item.contentType == 'music':
|
||||||
|
return 'musicvideo', 'musicvideos'
|
||||||
|
|
||||||
elif (item.contentType in ['movie'] and parent_item.action in parent_actions) \
|
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 (item.channel in ['videolibrary'] and parent_item.action in ['list_movies']) \
|
||||||
or (parent_item.channel in ['favorites'] and parent_item.action in ['mainlist']) \
|
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'
|
return 'episode', 'tvshows'
|
||||||
|
|
||||||
elif parent_item.action in ['get_seasons']:
|
elif parent_item.action in ['get_seasons']:
|
||||||
logger.debug('CONTENTTYPE:',item.contentType)
|
|
||||||
return 'season', 'tvshows'
|
return 'season', 'tvshows'
|
||||||
|
|
||||||
elif parent_item.action in ['getmainlist', '', 'getchanneltypes']:
|
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_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_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_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 -->
|
<!-- Contextual -->
|
||||||
<setting label="30024" type="lsep"/>
|
<setting label="30024" type="lsep"/>
|
||||||
<setting id="quick_menu" type="bool" label="60360" default="true"/>
|
<setting id="quick_menu" type="bool" label="60360" default="true"/>
|
||||||
|
|||||||
+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().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')
|
schedule.every().second.do(torrent.elementum_monitor).tag('screenOn')
|
||||||
|
|
||||||
def onDPMSActivated(self):
|
def onDPMSActivated(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user