From 892e8f6c6baef22318fc27debb46cba9fdaea139 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Mon, 16 Mar 2020 10:28:40 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20Qualit=C3=A0=20di=20Download?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformcode/platformtools.py | 13 ++++++++----- specials/downloads.py | 13 +++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index c13be809..afe2e129 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -273,6 +273,9 @@ def render_items(itemlist, parent_item): elif parent_item.list_type == '': listitem.addContextMenuItems(context_commands, replaceItems=True) + from specials import shortcuts + context_commands += shortcuts.context() + if not item.totalItems: item.totalItems = 0 xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url='%s?%s' % (sys.argv[0], item.tourl()), @@ -659,7 +662,7 @@ def set_context_commands(item, parent_item): if item.channel not in ["downloads", "videolibrary"] and item.server != 'torrent': # Descargar pelicula - if item.contentType == "movie" and item.contentTitle: + if item.contentType == "movie": context_commands.append((config.get_localized_string(60354), "XBMC.RunPlugin(%s?%s)" % (sys.argv[0], item.clone(channel="downloads", action="save_download", from_channel=item.channel, from_action=item.action) @@ -689,10 +692,10 @@ def set_context_commands(item, parent_item): from_channel=item.channel, from_action=item.action).tourl()))) - # Abrir configuración - if parent_item.channel not in ["setting", "news", "search"] and item.action == "play": - context_commands.append((config.get_localized_string(60358), "XBMC.Container.Update(%s?%s)" % - (sys.argv[0], Item(channel="setting", action="mainlist").tourl()))) + # # Abrir configuración + # if parent_item.channel not in ["setting", "news", "search"] and item.action == "play": + # context_commands.append((config.get_localized_string(60358), "XBMC.Container.Update(%s?%s)" % + # (sys.argv[0], Item(channel="setting", action="mainlist").tourl()))) # Buscar Trailer if item.action == "findvideos" or "buscar_trailer" in context: diff --git a/specials/downloads.py b/specials/downloads.py index 40254b61..38b478e7 100644 --- a/specials/downloads.py +++ b/specials/downloads.py @@ -625,8 +625,7 @@ def download_from_server(item): def download_from_best_server(item): - logger.info( - "contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url)) + logger.info("contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url)) result = {"downloadStatus": STATUS_CODES.error} @@ -639,18 +638,16 @@ def download_from_best_server(item): progreso.update(50, config.get_localized_string(70184), config.get_localized_string(70180) % item.contentChannel) if hasattr(channel, item.contentAction): - play_items = getattr(channel, item.contentAction)( - item.clone(action=item.contentAction, channel=item.contentChannel)) + play_items = getattr(channel, item.contentAction)(item.clone(action=item.contentAction, channel=item.contentChannel)) else: play_items = servertools.find_video_items(item.clone(action=item.contentAction, channel=item.contentChannel)) play_items = [x for x in play_items if x.action == "play" and not "trailer" in x.title.lower()] - progreso.update(100, config.get_localized_string(70183), config.get_localized_string(70181) % len(play_items), - config.get_localized_string(70182)) + progreso.update(100, config.get_localized_string(70183), config.get_localized_string(70181) % len(play_items), config.get_localized_string(70182)) - if config.get_setting("server_reorder", "downloads") == 1: - play_items.sort(key=sort_method) + # if config.get_setting("server_reorder", "downloads") == 1: + play_items.sort(key=sort_method) if progreso.iscanceled(): return {"downloadStatus": STATUS_CODES.canceled}