From 94727450ee93314163b30d5bc9f5e50f0205d3f3 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Wed, 5 Feb 2020 15:43:32 +0100 Subject: [PATCH] Fix channeltools --- channelselector.py | 6 +++--- core/channeltools.py | 32 ++++++++++++++------------------ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/channelselector.py b/channelselector.py index ebafe694..1c3cc598 100644 --- a/channelselector.py +++ b/channelselector.py @@ -150,9 +150,9 @@ def filterchannels(category, view="thumb_"): if channel_parameters["channel"] == 'community': continue - # si el canal no es compatible, no se muestra - if not channel_parameters["compatible"]: - continue + # # si el canal no es compatible, no se muestra + # if not channel_parameters["compatible"]: + # continue # Si no es un canal lo saltamos if not channel_parameters["channel"]: diff --git a/core/channeltools.py b/core/channeltools.py index 35e8f99c..cbd96130 100644 --- a/core/channeltools.py +++ b/core/channeltools.py @@ -5,7 +5,7 @@ from __future__ import absolute_import -from . import jsontools +from core import jsontools from platformcode import config, logger DEFAULT_UPDATE_URL = "/channels/" @@ -27,7 +27,7 @@ def is_enabled(channel_name): def get_channel_parameters(channel_name): - from . import filetools + from core import filetools global dict_channels_parameters if channel_name not in dict_channels_parameters: @@ -62,15 +62,11 @@ def get_channel_parameters(channel_name): # Imagenes: se admiten url y archivos locales dentro de "resources/images" if channel_parameters.get("thumbnail") and "://" not in channel_parameters["thumbnail"]: - channel_parameters["thumbnail"] = filetools.join(remote_path, "resources", "media", - "channels", "thumb", - channel_parameters["thumbnail"]) + channel_parameters["thumbnail"] = filetools.join(remote_path, "resources", "thumb", channel_parameters["thumbnail"]) if channel_parameters.get("banner") and "://" not in channel_parameters["banner"]: - channel_parameters["banner"] = filetools.join(remote_path, "resources", "media", - "channels", "banner", channel_parameters["banner"]) + channel_parameters["banner"] = filetools.join(remote_path, "resources", "banner", channel_parameters["banner"]) if channel_parameters.get("fanart") and "://" not in channel_parameters["fanart"]: - channel_parameters["fanart"] = filetools.join(remote_path, "resources", "media", - "channels", "fanart", channel_parameters["fanart"]) + channel_parameters["fanart"] = filetools.join(remote_path, "resources", channel_parameters["fanart"]) # Obtenemos si el canal tiene opciones de configuración channel_parameters["has_settings"] = False @@ -109,17 +105,17 @@ def get_channel_parameters(channel_name): def get_channel_json(channel_name): # logger.info("channel_name=" + channel_name) - from . import filetools + from core import filetools channel_json = None try: channel_path = filetools.join(config.get_runtime_path(), "channels", channel_name + ".json") - if not os.path.isfile(channel_path): + if not filetools.isfile(channel_path): channel_path = filetools.join(config.get_runtime_path(), 'channels', "porn", channel_name + ".json") - if not os.path.isfile(channel_path): + if not filetools.isfile(channel_path): channel_path = filetools.join(config.get_runtime_path(), "specials", channel_name + ".json") - if not os.path.isfile(channel_path): + if not filetools.isfile(channel_path): channel_path = filetools.join(config.get_runtime_path(), "servers", channel_name + ".json") - if not os.path.isfile(channel_path): + if not filetools.isfile(channel_path): channel_path = filetools.join(config.get_runtime_path(), "servers", "debriders", channel_name + ".json") @@ -181,7 +177,7 @@ def get_lang(channel_name): def get_default_settings(channel_name): - import filetools + from core import filetools default_path = filetools.join(config.get_runtime_path(), 'default_channel_settings' + '.json') default_file = jsontools.load(filetools.read(default_path)) @@ -189,7 +185,7 @@ def get_default_settings(channel_name): adult_path = filetools.join(config.get_runtime_path(), 'channels', 'porn', channel_name + '.json') # from core.support import dbg; dbg() - if os.path.exists(channel_path) or os.path.exists(adult_path): + if filetools.exists(channel_path) or filetools.exists(adult_path): default_controls = default_file['settings'] default_controls_renumber = default_file['renumber'] channel_json = get_channel_json(channel_name) @@ -258,7 +254,7 @@ def get_default_settings(channel_name): def get_channel_setting(name, channel, default=None): - from . import filetools + from core import filetools """ Retorna el valor de configuracion del parametro solicitado. @@ -316,7 +312,7 @@ def get_channel_setting(name, channel, default=None): def set_channel_setting(name, value, channel): - from . import filetools + from core import filetools """ Fija el valor de configuracion del parametro indicado.