piccole migliorie
This commit is contained in:
@@ -236,13 +236,17 @@ def render_items(itemlist, parent_item):
|
|||||||
def getCurrentView(item=None, parent_item=None):
|
def getCurrentView(item=None, parent_item=None):
|
||||||
if not parent_item:
|
if not parent_item:
|
||||||
info = xbmc.getInfoLabel('Container.FolderPath')
|
info = xbmc.getInfoLabel('Container.FolderPath')
|
||||||
parent_item = Item().fromurl(info) if info else Item()
|
if not info:
|
||||||
|
return None, None
|
||||||
|
parent_item = Item().fromurl(info)
|
||||||
if not item:
|
if not item:
|
||||||
info = xbmc.getInfoLabel('Container.ListItem(1).FileNameAndPath')
|
info = xbmc.getInfoLabel('Container.ListItem(1).FileNameAndPath')
|
||||||
|
if not info:
|
||||||
|
return None, None
|
||||||
item = Item().fromurl(info) if info else Item()
|
item = Item().fromurl(info) if info else Item()
|
||||||
parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list']
|
parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search']
|
||||||
|
|
||||||
if parent_item.action == 'findvideos' or parent_item.action in ['channel_search', 'new_search']:
|
if parent_item.action == 'findvideos' or (parent_item.action in ['channel_search', 'new_search'] and parent_item.infoLabels['tmdb_id']):
|
||||||
return 'server', 'addons' if config.get_setting('touch_view') else ''
|
return 'server', 'addons' if config.get_setting('touch_view') else ''
|
||||||
|
|
||||||
elif parent_item.action == 'mainlist':
|
elif parent_item.action == 'mainlist':
|
||||||
@@ -280,13 +284,14 @@ def set_view_mode(item, parent_item):
|
|||||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % 55)
|
xbmc.executebuiltin('Container.SetViewMode(%s)' % 55)
|
||||||
|
|
||||||
content, Type = getCurrentView(item, parent_item)
|
content, Type = getCurrentView(item, parent_item)
|
||||||
mode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
if content:
|
||||||
if mode == 0:
|
mode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||||
logger.info('default mode')
|
if mode == 0:
|
||||||
mode = 55
|
logger.info('default mode')
|
||||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content=Type)
|
mode = 55
|
||||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
xbmcplugin.setContent(handle=int(sys.argv[1]), content=Type)
|
||||||
logger.info('TYPE: ' + Type + ' - ' + 'CONTENT: ' + content)
|
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
||||||
|
logger.info('TYPE: ' + Type + ' - ' + 'CONTENT: ' + content)
|
||||||
|
|
||||||
|
|
||||||
# def render_items_old(itemlist, parent_item):
|
# def render_items_old(itemlist, parent_item):
|
||||||
@@ -756,7 +761,7 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
|
|||||||
elif item.action in ["detail", "findvideos"] and item.contentType == 'movie' and item.contentTitle:
|
elif item.action in ["detail", "findvideos"] and item.contentType == 'movie' and item.contentTitle:
|
||||||
context_commands.append((config.get_localized_string(60353), "XBMC.RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_pelicula_to_library&from_action=' + item.action)))
|
context_commands.append((config.get_localized_string(60353), "XBMC.RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_pelicula_to_library&from_action=' + item.action)))
|
||||||
|
|
||||||
if not item.local and item.channel not in ["downloads"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled'):
|
if not item.local and item.channel not in ["downloads", "filmontv"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled'):
|
||||||
# Download movie
|
# Download movie
|
||||||
if item.contentType == "movie":
|
if item.contentType == "movie":
|
||||||
context_commands.append((config.get_localized_string(60354), "XBMC.RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=downloads&action=save_download&from_channel=' + item.channel + '&from_action=' + item.action)))
|
context_commands.append((config.get_localized_string(60354), "XBMC.RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=downloads&action=save_download&from_channel=' + item.channel + '&from_action=' + item.action)))
|
||||||
@@ -781,8 +786,8 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
|
|||||||
# (sys.argv[0], Item(channel="setting", action="mainlist").tourl())))
|
# (sys.argv[0], Item(channel="setting", action="mainlist").tourl())))
|
||||||
|
|
||||||
# Open settings...
|
# Open settings...
|
||||||
if item.action in ["findvideos", 'episodios', 'check'] or "buscar_trailer" in context:
|
if item.action in ["findvideos", 'episodios', 'check', 'new_search'] or "buscar_trailer" in context:
|
||||||
context_commands.append((config.get_localized_string(60359), "XBMC.RunPlugin(%s?%s)" % (sys.argv[0], urllib.urlencode({ 'channel': "trailertools", 'action': "buscartrailer", 'search_title': item.fulltitle if item.fulltitle else item.contentTitle, 'contextual': True}))))
|
context_commands.append((config.get_localized_string(60359), "XBMC.RunPlugin(%s?%s)" % (sys.argv[0], urllib.urlencode({ 'channel': "trailertools", 'action': "buscartrailer", 'search_title': item.contentTitle if item.contentTitle else item.fulltitle, 'contextual': True}))))
|
||||||
|
|
||||||
if kwargs.get('superfavourites'):
|
if kwargs.get('superfavourites'):
|
||||||
context_commands.append((config.get_localized_string(60361), "XBMC.RunScript(special://home/addons/plugin.program.super.favourites/LaunchSFMenu.py)"))
|
context_commands.append((config.get_localized_string(60361), "XBMC.RunScript(special://home/addons/plugin.program.super.favourites/LaunchSFMenu.py)"))
|
||||||
|
|||||||
+5
-4
@@ -265,10 +265,11 @@ def viewmodeMonitor():
|
|||||||
if currentModeName and 'plugin.video.kod' in xbmc.getInfoLabel(
|
if currentModeName and 'plugin.video.kod' in xbmc.getInfoLabel(
|
||||||
'Container.FolderPath') and currentMode < 1000 and currentMode > 50: # inside addon and in itemlist view
|
'Container.FolderPath') and currentMode < 1000 and currentMode > 50: # inside addon and in itemlist view
|
||||||
content, Type = platformtools.getCurrentView()
|
content, Type = platformtools.getCurrentView()
|
||||||
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
if content:
|
||||||
if currentMode != defaultMode:
|
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||||
logger.info('viewmode changed: ' + currentModeName + '-' + str(currentMode) + ' - content: ' + content)
|
if currentMode != defaultMode:
|
||||||
config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
|
logger.info('viewmode changed: ' + currentModeName + '-' + str(currentMode) + ' - content: ' + content)
|
||||||
|
config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
|
||||||
except:
|
except:
|
||||||
logger.error(traceback.print_exc())
|
logger.error(traceback.print_exc())
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ def buscartrailer(item, trailers=[]):
|
|||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
if item.search_title:
|
if item.search_title:
|
||||||
item.contentTitle = item.search_title
|
item.contentTitle = urllib.unquote_plus(item.search_title)
|
||||||
elif item.contentTitle != "":
|
elif item.contentTitle != "":
|
||||||
item.contentTitle = item.contentTitle.strip()
|
item.contentTitle = item.contentTitle.strip()
|
||||||
elif keyboard:
|
elif keyboard:
|
||||||
|
|||||||
Reference in New Issue
Block a user