sintaxis, fix type with adult, update version in mediaserver, fix to avoid show "no errors", indent, clean settings.xml file and updated
This commit is contained in:
+9
-10
@@ -22,7 +22,7 @@ websocket_port = config.get_setting("websocket.port")
|
|||||||
myip = config.get_local_ip()
|
myip = config.get_local_ip()
|
||||||
|
|
||||||
|
|
||||||
def ThreadNameWrap(func):
|
def thread_name_wrap(func):
|
||||||
@wraps(func)
|
@wraps(func)
|
||||||
def bar(*args, **kw):
|
def bar(*args, **kw):
|
||||||
if "name" not in kw:
|
if "name" not in kw:
|
||||||
@@ -32,7 +32,7 @@ def ThreadNameWrap(func):
|
|||||||
return bar
|
return bar
|
||||||
|
|
||||||
|
|
||||||
threading.Thread.__init__ = ThreadNameWrap(threading.Thread.__init__)
|
threading.Thread.__init__ = thread_name_wrap(threading.Thread.__init__)
|
||||||
|
|
||||||
if sys.version_info < (2, 7, 11):
|
if sys.version_info < (2, 7, 11):
|
||||||
import ssl
|
import ssl
|
||||||
@@ -40,7 +40,7 @@ if sys.version_info < (2, 7, 11):
|
|||||||
ssl._create_default_https_context = ssl._create_unverified_context
|
ssl._create_default_https_context = ssl._create_unverified_context
|
||||||
|
|
||||||
|
|
||||||
def MostrarInfo():
|
def show_info():
|
||||||
os.system('cls' if os.name == 'nt' else 'clear')
|
os.system('cls' if os.name == 'nt' else 'clear')
|
||||||
print ("--------------------------------------------------------------------")
|
print ("--------------------------------------------------------------------")
|
||||||
print ("Alfa Iniciado")
|
print ("Alfa Iniciado")
|
||||||
@@ -54,7 +54,6 @@ def MostrarInfo():
|
|||||||
print ("Bookmark Path : " + config.get_setting("bookmarkpath"))
|
print ("Bookmark Path : " + config.get_setting("bookmarkpath"))
|
||||||
print ("Videolibrary Path : " + config.get_setting("videolibrarypath"))
|
print ("Videolibrary Path : " + config.get_setting("videolibrarypath"))
|
||||||
print ("--------------------------------------------------------------------")
|
print ("--------------------------------------------------------------------")
|
||||||
conexiones = []
|
|
||||||
controllers = platformtools.controllers
|
controllers = platformtools.controllers
|
||||||
for a in controllers:
|
for a in controllers:
|
||||||
try:
|
try:
|
||||||
@@ -68,8 +67,8 @@ def start():
|
|||||||
logger.info("server init...")
|
logger.info("server init...")
|
||||||
config.verify_directories_created()
|
config.verify_directories_created()
|
||||||
try:
|
try:
|
||||||
HTTPServer.start(MostrarInfo)
|
HTTPServer.start(show_info)
|
||||||
WebSocket.start(MostrarInfo)
|
WebSocket.start(show_info)
|
||||||
|
|
||||||
# Da por levantado el servicio
|
# Da por levantado el servicio
|
||||||
logger.info("--------------------------------------------------------------------")
|
logger.info("--------------------------------------------------------------------")
|
||||||
@@ -84,10 +83,10 @@ def start():
|
|||||||
logger.info("Bookmark Path : " + config.get_setting("bookmarkpath"))
|
logger.info("Bookmark Path : " + config.get_setting("bookmarkpath"))
|
||||||
logger.info("VideoLibrary Path : " + config.get_setting("videolibrarypath"))
|
logger.info("VideoLibrary Path : " + config.get_setting("videolibrarypath"))
|
||||||
logger.info("--------------------------------------------------------------------")
|
logger.info("--------------------------------------------------------------------")
|
||||||
MostrarInfo()
|
show_info()
|
||||||
|
|
||||||
start = True
|
flag = True
|
||||||
while start:
|
while flag:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
@@ -96,7 +95,7 @@ def start():
|
|||||||
print 'Deteniendo el servidor WebSocket...'
|
print 'Deteniendo el servidor WebSocket...'
|
||||||
WebSocket.stop()
|
WebSocket.stop()
|
||||||
print 'Alfa Detenido'
|
print 'Alfa Detenido'
|
||||||
start = False
|
flag = False
|
||||||
|
|
||||||
|
|
||||||
# Inicia el programa
|
# Inicia el programa
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
PLATFORM_NAME = "mediaserver"
|
PLATFORM_NAME = "mediaserver"
|
||||||
PLUGIN_NAME = "alfa"
|
PLUGIN_NAME = "alfa"
|
||||||
|
|
||||||
settings_dic = {}
|
settings_dic = {}
|
||||||
settings_types = {}
|
|
||||||
adult_setting = {}
|
adult_setting = {}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,14 +52,14 @@ def get_system_platform():
|
|||||||
|
|
||||||
|
|
||||||
def open_settings():
|
def open_settings():
|
||||||
Opciones = []
|
options = []
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
settings = open(menufilepath, 'rb').read()
|
settings = open(menufilepath, 'rb').read()
|
||||||
xmldoc = minidom.parseString(settings)
|
xmldoc = minidom.parseString(settings)
|
||||||
for category in xmldoc.getElementsByTagName("category"):
|
for category in xmldoc.getElementsByTagName("category"):
|
||||||
for setting in category.getElementsByTagName("setting"):
|
for setting in category.getElementsByTagName("setting"):
|
||||||
Opciones.append(dict(setting.attributes.items() + [(u"category", category.getAttribute("label")),
|
options.append(dict(setting.attributes.items() + [(u"category", category.getAttribute("label")),
|
||||||
(u"value", get_setting(setting.getAttribute("id")))]))
|
(u"value", get_setting(setting.getAttribute("id")))]))
|
||||||
|
|
||||||
from platformcode import platformtools
|
from platformcode import platformtools
|
||||||
global adult_setting
|
global adult_setting
|
||||||
@@ -69,7 +69,7 @@ def open_settings():
|
|||||||
adult_mode = get_setting('adult_mode')
|
adult_mode = get_setting('adult_mode')
|
||||||
adult_request_password = get_setting('adult_request_password')
|
adult_request_password = get_setting('adult_request_password')
|
||||||
|
|
||||||
platformtools.open_settings(Opciones)
|
platformtools.open_settings(options)
|
||||||
|
|
||||||
# Hemos accedido a la seccion de Canales para adultos
|
# Hemos accedido a la seccion de Canales para adultos
|
||||||
if get_setting('adult_aux_intro_password'):
|
if get_setting('adult_aux_intro_password'):
|
||||||
@@ -82,22 +82,16 @@ def open_settings():
|
|||||||
set_setting('adult_password', get_setting('adult_aux_new_password1'))
|
set_setting('adult_password', get_setting('adult_aux_new_password1'))
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok("Canales para adultos",
|
platformtools.dialog_ok("Canales para adultos",
|
||||||
"Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden.",
|
"Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden."
|
||||||
"Entre de nuevo en 'Preferencias' para cambiar la contraseña")
|
, "Entre de nuevo en 'Preferencias' para cambiar la contraseña")
|
||||||
|
|
||||||
# Fijar adult_pin
|
|
||||||
adult_pin = ""
|
|
||||||
if get_setting("adult_request_password") == True:
|
|
||||||
adult_pin = get_setting("adult_password")
|
|
||||||
set_setting("adult_pin", adult_pin)
|
|
||||||
|
|
||||||
# Solo esta sesion:
|
# Solo esta sesion:
|
||||||
id = threading.current_thread().name
|
# id = threading.current_thread().name
|
||||||
if get_setting("adult_mode") == 2:
|
# if get_setting("adult_mode") == 2:
|
||||||
adult_setting[id] = True
|
# adult_setting[id] = True
|
||||||
set_setting("adult_mode", "0")
|
# set_setting("adult_mode", 0)
|
||||||
else:
|
# else:
|
||||||
adult_setting = {}
|
# adult_setting = {}
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok("Canales para adultos", "La contraseña no es correcta.",
|
platformtools.dialog_ok("Canales para adultos", "La contraseña no es correcta.",
|
||||||
@@ -112,24 +106,30 @@ def open_settings():
|
|||||||
set_setting('adult_aux_new_password2', '')
|
set_setting('adult_aux_new_password2', '')
|
||||||
|
|
||||||
|
|
||||||
def get_setting(name, channel="", server=""):
|
def get_setting(name, channel="", server="", default=None):
|
||||||
"""
|
"""
|
||||||
Retorna el valor de configuracion del parametro solicitado.
|
Retorna el valor de configuracion del parametro solicitado.
|
||||||
|
|
||||||
Devuelve el valor del parametro 'name' en la configuracion global o en la configuracion propia del canal 'channel'.
|
Devuelve el valor del parametro 'name' en la configuracion global, en la configuracion propia del canal 'channel'
|
||||||
|
o en la del servidor 'server'.
|
||||||
|
|
||||||
Si se especifica el nombre del canal busca en la ruta \addon_data\plugin.video.alfa\settings_channels el
|
Los parametros channel y server no deben usarse simultaneamente. Si se especifica el nombre del canal se devolvera
|
||||||
archivo channel_data.json y lee el valor del parametro 'name'. Si el archivo channel_data.json no existe busca en la
|
el resultado de llamar a channeltools.get_channel_setting(name, channel, default). Si se especifica el nombre del
|
||||||
carpeta channels el archivo channel.xml y crea un archivo channel_data.json antes de retornar el valor solicitado.
|
servidor se devolvera el resultado de llamar a servertools.get_channel_setting(name, server, default). Si no se
|
||||||
Si el parametro 'name' no existe en channel_data.json lo busca en la configuracion global y si ahi tampoco existe
|
especifica ninguno de los anteriores se devolvera el valor del parametro en la configuracion global si existe o
|
||||||
devuelve un str vacio.
|
el valor default en caso contrario.
|
||||||
|
|
||||||
Parametros:
|
@param name: nombre del parametro
|
||||||
name -- nombre del parametro
|
@type name: str
|
||||||
channel [opcional] -- nombre del canal
|
@param channel: nombre del canal
|
||||||
|
@type channel: str
|
||||||
|
@param server: nombre del servidor
|
||||||
|
@type server: str
|
||||||
|
@param default: valor devuelto en caso de que no exista el parametro name
|
||||||
|
@type default: any
|
||||||
|
|
||||||
Retorna:
|
@return: El valor del parametro 'name'
|
||||||
value -- El valor del parametro 'name'
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ def get_setting(name, channel="", server=""):
|
|||||||
|
|
||||||
# logger.info("config.get_setting reading channel setting '"+name+"' from channel json")
|
# logger.info("config.get_setting reading channel setting '"+name+"' from channel json")
|
||||||
from core import channeltools
|
from core import channeltools
|
||||||
value = channeltools.get_channel_setting(name, channel)
|
value = channeltools.get_channel_setting(name, channel, default)
|
||||||
# logger.info("config.get_setting -> '"+repr(value)+"'")
|
# logger.info("config.get_setting -> '"+repr(value)+"'")
|
||||||
|
|
||||||
return value
|
return value
|
||||||
@@ -146,7 +146,7 @@ def get_setting(name, channel="", server=""):
|
|||||||
elif server:
|
elif server:
|
||||||
# logger.info("config.get_setting reading server setting '"+name+"' from server json")
|
# logger.info("config.get_setting reading server setting '"+name+"' from server json")
|
||||||
from core import servertools
|
from core import servertools
|
||||||
value = servertools.get_server_setting(name, server)
|
value = servertools.get_server_setting(name, server, default)
|
||||||
# logger.info("config.get_setting -> '"+repr(value)+"'")
|
# logger.info("config.get_setting -> '"+repr(value)+"'")
|
||||||
|
|
||||||
return value
|
return value
|
||||||
@@ -155,31 +155,28 @@ def get_setting(name, channel="", server=""):
|
|||||||
else:
|
else:
|
||||||
# logger.info("config.get_setting reading main setting '"+name+"'")
|
# logger.info("config.get_setting reading main setting '"+name+"'")
|
||||||
global settings_dic
|
global settings_dic
|
||||||
value = settings_dic.get(name, "")
|
value = settings_dic.get(name, default)
|
||||||
|
if value == default:
|
||||||
if name == "adult_mode":
|
return value
|
||||||
global adult_setting
|
|
||||||
id = threading.current_thread().name
|
|
||||||
if adult_setting.get(id) == True:
|
|
||||||
value = "2"
|
|
||||||
|
|
||||||
|
# logger.info("config.get_setting -> '"+value+"'")
|
||||||
# hack para devolver el tipo correspondiente
|
# hack para devolver el tipo correspondiente
|
||||||
global settings_types
|
if value == "true":
|
||||||
|
return True
|
||||||
|
elif value == "false":
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
# special case return as str
|
||||||
|
if name in ["adult_password", "adult_aux_intro_password", "adult_aux_new_password1",
|
||||||
|
"adult_aux_new_password2"]:
|
||||||
|
return value
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
value = int(value)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
if settings_types.get(name) in ['enum', 'number']:
|
return value
|
||||||
value = int(value)
|
|
||||||
|
|
||||||
elif settings_types.get(name) == 'bool':
|
|
||||||
value = value == 'true'
|
|
||||||
|
|
||||||
elif not settings_types.has_key(name):
|
|
||||||
try:
|
|
||||||
t = eval(value)
|
|
||||||
value = t[0](t[1])
|
|
||||||
except:
|
|
||||||
value = None
|
|
||||||
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def set_setting(name, value, channel="", server=""):
|
def set_setting(name, value, channel="", server=""):
|
||||||
@@ -214,25 +211,16 @@ def set_setting(name, value, channel="", server=""):
|
|||||||
return servertools.set_server_setting(name, value, server)
|
return servertools.set_server_setting(name, value, server)
|
||||||
else:
|
else:
|
||||||
global settings_dic
|
global settings_dic
|
||||||
global settings_types
|
|
||||||
|
|
||||||
if settings_types.get(name) == 'bool':
|
if isinstance(value, bool):
|
||||||
if value:
|
if value:
|
||||||
new_value = "true"
|
value = "true"
|
||||||
else:
|
else:
|
||||||
new_value = "false"
|
value = "false"
|
||||||
|
elif isinstance(value, (int, long)):
|
||||||
elif settings_types.get(name):
|
value = str(value)
|
||||||
new_value = str(value)
|
|
||||||
|
|
||||||
else:
|
|
||||||
if isinstance(value, basestring):
|
|
||||||
new_value = "(%s, %s)" % (type(value).__name__, repr(value))
|
|
||||||
else:
|
|
||||||
new_value = "(%s, %s)" % (type(value).__name__, value)
|
|
||||||
|
|
||||||
settings_dic[name] = new_value
|
|
||||||
|
|
||||||
|
settings_dic[name] = value
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
# Crea un Nuevo XML vacio
|
# Crea un Nuevo XML vacio
|
||||||
new_settings = minidom.getDOMImplementation().createDocument(None, "settings", None)
|
new_settings = minidom.getDOMImplementation().createDocument(None, "settings", None)
|
||||||
@@ -339,11 +327,9 @@ def get_local_ip():
|
|||||||
|
|
||||||
def load_settings():
|
def load_settings():
|
||||||
global settings_dic
|
global settings_dic
|
||||||
global settings_types
|
|
||||||
defaults = {}
|
defaults = {}
|
||||||
from xml.etree import ElementTree
|
from xml.etree import ElementTree
|
||||||
|
|
||||||
encontrado = False
|
|
||||||
# Lee el archivo XML (si existe)
|
# Lee el archivo XML (si existe)
|
||||||
if os.path.exists(configfilepath):
|
if os.path.exists(configfilepath):
|
||||||
settings = open(configfilepath, 'rb').read()
|
settings = open(configfilepath, 'rb').read()
|
||||||
@@ -357,10 +343,9 @@ def load_settings():
|
|||||||
for target in category.findall("setting"):
|
for target in category.findall("setting"):
|
||||||
if target.get("id"):
|
if target.get("id"):
|
||||||
defaults[target.get("id")] = target.get("default")
|
defaults[target.get("id")] = target.get("default")
|
||||||
settings_types[target.get("id")] = target.get("type")
|
|
||||||
|
|
||||||
for key in defaults:
|
for key in defaults:
|
||||||
if not key in settings_dic:
|
if key not in settings_dic:
|
||||||
settings_dic[key] = defaults[key]
|
settings_dic[key] = defaults[key]
|
||||||
set_settings(settings_dic)
|
set_settings(settings_dic)
|
||||||
|
|
||||||
@@ -387,7 +372,14 @@ def set_settings(JsonRespuesta):
|
|||||||
# Fichero de configuración
|
# Fichero de configuración
|
||||||
menufilepath = os.path.join(get_runtime_path(), "resources", "settings.xml")
|
menufilepath = os.path.join(get_runtime_path(), "resources", "settings.xml")
|
||||||
configfilepath = os.path.join(get_data_path(), "settings.xml")
|
configfilepath = os.path.join(get_data_path(), "settings.xml")
|
||||||
if not os.path.exists(get_data_path()): os.mkdir(get_data_path())
|
if not os.path.exists(get_data_path()):
|
||||||
|
os.mkdir(get_data_path())
|
||||||
# Literales
|
# Literales
|
||||||
TRANSLATION_FILE_PATH = os.path.join(get_runtime_path(), "resources", "language", "Spanish", "strings.xml")
|
TRANSLATION_FILE_PATH = os.path.join(get_runtime_path(), "resources", "language", "Spanish", "strings.xml")
|
||||||
load_settings()
|
load_settings()
|
||||||
|
|
||||||
|
# modo adulto:
|
||||||
|
# sistema actual 0: Nunca, 1:Siempre, 2:Solo hasta que se reinicie sesión
|
||||||
|
# si es == 2 lo desactivamos.
|
||||||
|
if get_setting("adult_mode") == 2:
|
||||||
|
set_setting("adult_mode", 0)
|
||||||
|
|||||||
@@ -29,19 +29,20 @@ def start():
|
|||||||
def run(item):
|
def run(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
# Muestra el item en el log:
|
# Muestra el item en el log:
|
||||||
PrintItems(item)
|
print_items(item)
|
||||||
|
|
||||||
# Control Parental, comprueba si es adulto o no
|
# Control Parental, comprueba si es adulto o no
|
||||||
if item.action == "mainlist":
|
if item.action == "mainlist":
|
||||||
# Parental control
|
# Parental control
|
||||||
if channeltools.is_adult(item.channel) and config.get_setting("adult_pin") != "":
|
if channeltools.is_adult(item.channel) and config.get_setting("adult_request_password"):
|
||||||
tecleado = platformtools.dialog_input("", "Contraseña para canales de adultos", True)
|
tecleado = platformtools.dialog_input("", "Contraseña para canales de adultos", True)
|
||||||
if tecleado is None or tecleado != config.get_setting("adult_pin"):
|
if tecleado is None or tecleado != config.get_setting("adult_password"):
|
||||||
platformtools.render_items(None, item)
|
platformtools.render_items(None, item)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Importa el canal para el item, todo item debe tener un canal, sino sale de la función
|
# Importa el canal para el item, todo item debe tener un canal, sino sale de la función
|
||||||
if item.channel: channelmodule = ImportarCanal(item)
|
if item.channel:
|
||||||
|
channelmodule = import_channel(item)
|
||||||
|
|
||||||
# If item has no action, stops here
|
# If item has no action, stops here
|
||||||
if item.action == "":
|
if item.action == "":
|
||||||
@@ -153,13 +154,13 @@ def run(item):
|
|||||||
itemlist = [Item(title="No hay elementos para mostrar", thumbnail=get_thumb("error.png"))]
|
itemlist = [Item(title="No hay elementos para mostrar", thumbnail=get_thumb("error.png"))]
|
||||||
|
|
||||||
# Imprime en el log el resultado
|
# Imprime en el log el resultado
|
||||||
PrintItems(itemlist)
|
print_items(itemlist)
|
||||||
|
|
||||||
# Muestra los resultados en pantalla
|
# Muestra los resultados en pantalla
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|
||||||
|
|
||||||
def ImportarCanal(item):
|
def import_channel(item):
|
||||||
channel = item.channel
|
channel = item.channel
|
||||||
channelmodule = ""
|
channelmodule = ""
|
||||||
if os.path.exists(os.path.join(config.get_runtime_path(), "channels", channel + ".py")):
|
if os.path.exists(os.path.join(config.get_runtime_path(), "channels", channel + ".py")):
|
||||||
@@ -171,7 +172,7 @@ def ImportarCanal(item):
|
|||||||
return channelmodule
|
return channelmodule
|
||||||
|
|
||||||
|
|
||||||
def PrintItems(itemlist):
|
def print_items(itemlist):
|
||||||
if type(itemlist) == list:
|
if type(itemlist) == list:
|
||||||
if len(itemlist) > 0:
|
if len(itemlist) > 0:
|
||||||
logger.info("Items devueltos")
|
logger.info("Items devueltos")
|
||||||
@@ -197,13 +198,13 @@ def add_pelicula_to_library(item):
|
|||||||
|
|
||||||
|
|
||||||
def add_serie_to_library(item):
|
def add_serie_to_library(item):
|
||||||
channel = ImportarCanal(item)
|
channel = import_channel(item)
|
||||||
videolibrarytools.add_tvshow(item, channel)
|
videolibrarytools.add_tvshow(item, channel)
|
||||||
|
|
||||||
|
|
||||||
def download_all_episodes(item, first_episode="", preferred_server="vidspot", filter_language=""):
|
def download_all_episodes(item, first_episode="", preferred_server="vidspot", filter_language=""):
|
||||||
logger.info("show=" + item.show)
|
logger.info("show=" + item.show)
|
||||||
channel = ImportarCanal(item)
|
channel = import_channel(item)
|
||||||
show_title = item.show
|
show_title = item.show
|
||||||
|
|
||||||
# Obtiene el listado desde el que se llamó
|
# Obtiene el listado desde el que se llamó
|
||||||
|
|||||||
@@ -16,15 +16,14 @@
|
|||||||
<setting id="server_stats" type="bool" label="Enviar estadisticas sobre el uso de servidores" default="true"/>
|
<setting id="server_stats" type="bool" label="Enviar estadisticas sobre el uso de servidores" default="true"/>
|
||||||
<setting type="sep"/>
|
<setting type="sep"/>
|
||||||
<setting label="Canales para adultos" type="lsep"/>
|
<setting label="Canales para adultos" type="lsep"/>
|
||||||
<setting id="adult_aux_intro_password" type="text" label="Contraseña:" option="hidden" default=""/>
|
<setting id="adult_aux_intro_password" type="text" label="Contraseña (por defecto 0000):" option="hidden" default=""/>
|
||||||
<setting id="adult_mode" type="enum" values="Nunca|Siempre|Solo para esta sesión" label="30002" enable="!eq(-1,)" default="0"/>
|
<setting id="adult_mode" type="enum" values="Nunca|Siempre|Solo para esta sesión" label="30002" enable="!eq(-1,)" default="0"/>
|
||||||
<setting id="adult_request_password" type="bool" label="Solicitar contraseña para abrir canal de adultos" enable="!eq(-1,0)+!eq(-2,)" default="true"/>
|
<setting id="adult_request_password" type="bool" label="Solicitar contraseña para abrir canales de adultos" enable="!eq(-1,0)+!eq(-2,)" default="true"/>
|
||||||
<setting id="adult_aux_new_password1" type="text" label="Nueva contraseña:" option="hidden" enable="!eq(-3,)" default=""/>
|
<setting id="adult_aux_new_password1" type="text" label="Nueva contraseña:" option="hidden" enable="!eq(-3,)" default=""/>
|
||||||
<setting id="adult_aux_new_password2" type="text" label="Confirmar nueva contraseña:" option="hidden" enable="!eq(-1,)" default=""/>
|
<setting id="adult_aux_new_password2" type="text" label="Confirmar nueva contraseña:" option="hidden" enable="!eq(-1,)" default=""/>
|
||||||
|
|
||||||
<!--<setting type="sep"/>-->
|
<!--<setting type="sep"/>-->
|
||||||
<!--<setting label="Actualizaciones" type="lsep"/>-->
|
<!--<setting label="Actualizaciones" type="lsep"/>-->
|
||||||
|
|
||||||
<!--<setting id="plugin_updates_available" type="number" label="Number of updates available" default="0" visible="false"/>-->
|
<!--<setting id="plugin_updates_available" type="number" label="Number of updates available" default="0" visible="false"/>-->
|
||||||
<!--<setting id="check_for_plugin_updates" type="bool" label="30001" default="true"/>-->
|
<!--<setting id="check_for_plugin_updates" type="bool" label="30001" default="true"/>-->
|
||||||
<!--<setting id="check_for_channel_updates" type="bool" label="30004" default="true"/>-->
|
<!--<setting id="check_for_channel_updates" type="bool" label="30004" default="true"/>-->
|
||||||
@@ -32,20 +31,14 @@
|
|||||||
|
|
||||||
<!-- Path downloads and subtitles -->
|
<!-- Path downloads and subtitles -->
|
||||||
<category label="30501">
|
<category label="30501">
|
||||||
<!--setting id="subtitulo" type="bool" label="30021" default="false"/>
|
<setting type="sep"/>
|
||||||
<setting id="subtitle_type" type="enum" lvalues="30432|30434|30433" label ="30431" enable ="eq(-1,true)" default="0"/>
|
|
||||||
<setting id="subtitlepath_folder" type="folder" source="" enable = "eq(-1,0)+eq(-2,true)" label="30435" default=""/>
|
|
||||||
<setting id="subtitlepath_file" type="file" source="" enable = "eq(-2,2)+eq(-3,true)" label="30436" default=""/>
|
|
||||||
<setting id="subtitlepath_keyboard" type="text" enable ="eq(-3,1)+eq(-4,true)" label="30437" default=""/>
|
|
||||||
|
|
||||||
<setting type="sep"/-->
|
|
||||||
<setting id="downloadpath" type="text" label="30017" default=""/>
|
<setting id="downloadpath" type="text" label="30017" default=""/>
|
||||||
<setting id="downloadlistpath" type="text" label="30018" default=""/>
|
<setting id="downloadlistpath" type="text" label="30018" default=""/>
|
||||||
<setting id="videolibrarypath" type="text" label="30067" default=""/>
|
<setting id="videolibrarypath" type="text" label="30067" default=""/>
|
||||||
|
|
||||||
<setting type="sep"/>
|
<setting type="sep"/>
|
||||||
<setting label="Nombre de carpetas" type="lsep"/>
|
<setting label="30131" type="lsep"/>
|
||||||
<setting id="folder_tvshows" type="text" label="Series" default="SERIES"/>
|
<setting id="folder_tvshows" type="text" label="Nombre de carpeta para 'Series'" default="SERIES"/>
|
||||||
<setting id="folder_movies" type="text" label="Peliculas" default="CINE"/>
|
<setting id="folder_movies" type="text" label="Nombre de carpeta para 'Peliculas'" default="CINE"/>
|
||||||
</category>
|
</category>
|
||||||
</settings>
|
</settings>
|
||||||
@@ -138,17 +138,18 @@ def get_channel_parameters(channel_name):
|
|||||||
def get_channel_json(channel_name):
|
def get_channel_json(channel_name):
|
||||||
# logger.info("channel_name=" + channel_name)
|
# logger.info("channel_name=" + channel_name)
|
||||||
import filetools
|
import filetools
|
||||||
|
channel_json = None
|
||||||
try:
|
try:
|
||||||
channel_path = filetools.join(config.get_runtime_path(), "channels", channel_name + ".json")
|
channel_path = filetools.join(config.get_runtime_path(), "channels", channel_name + ".json")
|
||||||
# logger.info("channel_data=" + channel_path)
|
if filetools.isfile(channel_path):
|
||||||
channel_json = jsontools.load(filetools.read(channel_path))
|
# logger.info("channel_data=" + channel_path)
|
||||||
# logger.info("channel_json= %s" % channel_json)
|
channel_json = jsontools.load(filetools.read(channel_path))
|
||||||
|
# logger.info("channel_json= %s" % channel_json)
|
||||||
|
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
template = "An exception of type %s occured. Arguments:\n%r"
|
template = "An exception of type %s occured. Arguments:\n%r"
|
||||||
message = template % (type(ex).__name__, ex.args)
|
message = template % (type(ex).__name__, ex.args)
|
||||||
logger.error(" %s" % message)
|
logger.error(" %s" % message)
|
||||||
channel_json = None
|
|
||||||
|
|
||||||
return channel_json
|
return channel_json
|
||||||
|
|
||||||
@@ -187,10 +188,10 @@ def get_channel_setting(name, channel, default=None):
|
|||||||
@param channel: nombre del canal
|
@param channel: nombre del canal
|
||||||
@type channel: str
|
@type channel: str
|
||||||
@param default: valor devuelto en caso de que no exista el parametro name
|
@param default: valor devuelto en caso de que no exista el parametro name
|
||||||
@type default: cualquiera
|
@type default: any
|
||||||
|
|
||||||
@return: El valor del parametro 'name'
|
@return: El valor del parametro 'name'
|
||||||
@rtype: El tipo del valor del parametro
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
file_settings = os.path.join(config.get_data_path(), "settings_channels", channel + "_data.json")
|
file_settings = os.path.join(config.get_data_path(), "settings_channels", channel + "_data.json")
|
||||||
|
|||||||
@@ -565,10 +565,10 @@ def get_server_setting(name, server, default=None):
|
|||||||
@param server: nombre del servidor
|
@param server: nombre del servidor
|
||||||
@type server: str
|
@type server: str
|
||||||
@param default: valor devuelto en caso de que no exista el parametro name
|
@param default: valor devuelto en caso de que no exista el parametro name
|
||||||
@type default: cualquiera
|
@type default: any
|
||||||
|
|
||||||
@return: El valor del parametro 'name'
|
@return: El valor del parametro 'name'
|
||||||
@rtype: El tipo del valor del parametro
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Creamos la carpeta si no existe
|
# Creamos la carpeta si no existe
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ def get_current_plugin_version():
|
|||||||
|
|
||||||
|
|
||||||
def get_current_plugin_version_tag():
|
def get_current_plugin_version_tag():
|
||||||
return "4.3.0-beta1"
|
return "1.5.7"
|
||||||
|
|
||||||
|
|
||||||
def get_current_plugin_date():
|
def get_current_plugin_date():
|
||||||
return "30/06/2017"
|
return "22/08/2017"
|
||||||
|
|
||||||
|
|
||||||
def get_current_channels_version():
|
def get_current_channels_version():
|
||||||
|
|||||||
@@ -114,8 +114,8 @@ def open_settings():
|
|||||||
set_setting('adult_password', settings_post['adult_aux_new_password1'])
|
set_setting('adult_password', settings_post['adult_aux_new_password1'])
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok("Canales para adultos",
|
platformtools.dialog_ok("Canales para adultos",
|
||||||
"Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden.",
|
"Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden."
|
||||||
"Entre de nuevo en 'Preferencias' para cambiar la contraseña")
|
, "Entre de nuevo en 'Preferencias' para cambiar la contraseña")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok("Canales para adultos", "La contraseña no es correcta.",
|
platformtools.dialog_ok("Canales para adultos", "La contraseña no es correcta.",
|
||||||
@@ -133,8 +133,8 @@ def open_settings():
|
|||||||
# si se ha cambiado la ruta de la videoteca llamamos a comprobar directorios para que lo cree y pregunte
|
# si se ha cambiado la ruta de la videoteca llamamos a comprobar directorios para que lo cree y pregunte
|
||||||
# automaticamente si configurar la videoteca
|
# automaticamente si configurar la videoteca
|
||||||
if settings_pre.get("videolibrarypath", None) != settings_post.get("videolibrarypath", None) or \
|
if settings_pre.get("videolibrarypath", None) != settings_post.get("videolibrarypath", None) or \
|
||||||
settings_pre.get("folder_movies", None) != settings_post.get("folder_movies", None) or \
|
settings_pre.get("folder_movies", None) != settings_post.get("folder_movies", None) or \
|
||||||
settings_pre.get("folder_tvshows", None) != settings_post.get("folder_tvshows", None):
|
settings_pre.get("folder_tvshows", None) != settings_post.get("folder_tvshows", None):
|
||||||
verify_directories_created()
|
verify_directories_created()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -165,10 +165,10 @@ def get_setting(name, channel="", server="", default=None):
|
|||||||
@param server: nombre del servidor
|
@param server: nombre del servidor
|
||||||
@type server: str
|
@type server: str
|
||||||
@param default: valor devuelto en caso de que no exista el parametro name
|
@param default: valor devuelto en caso de que no exista el parametro name
|
||||||
@type default: cualquiera
|
@type default: any
|
||||||
|
|
||||||
@return: El valor del parametro 'name'
|
@return: El valor del parametro 'name'
|
||||||
@rtype: El tipo del valor del parametro
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -205,7 +205,8 @@ def get_setting(name, channel="", server="", default=None):
|
|||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
# special case return as str
|
# special case return as str
|
||||||
if name in ["adult_password", "adult_aux_intro_password", "adult_aux_new_password1", "adult_aux_new_password2"]:
|
if name in ["adult_password", "adult_aux_intro_password", "adult_aux_new_password1",
|
||||||
|
"adult_aux_new_password2"]:
|
||||||
return value
|
return value
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@@ -395,7 +396,7 @@ def verify_directories_created():
|
|||||||
for f in files:
|
for f in files:
|
||||||
if not filetools.exists(filetools.join(default, folder, f)) or \
|
if not filetools.exists(filetools.join(default, folder, f)) or \
|
||||||
(filetools.getsize(filetools.join(default, folder, f)) !=
|
(filetools.getsize(filetools.join(default, folder, f)) !=
|
||||||
filetools.getsize(filetools.join(default, '720p', f))):
|
filetools.getsize(filetools.join(default, '720p', f))):
|
||||||
filetools.copy(filetools.join(default, '720p', f),
|
filetools.copy(filetools.join(default, '720p', f),
|
||||||
filetools.join(default, folder, f),
|
filetools.join(default, folder, f),
|
||||||
True)
|
True)
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
<setting id="adult_aux_new_password1" type="text" label="Nueva contraseña:" option="hidden" enable="!eq(-3,)" default=""/>
|
<setting id="adult_aux_new_password1" type="text" label="Nueva contraseña:" option="hidden" enable="!eq(-3,)" default=""/>
|
||||||
<setting id="adult_aux_new_password2" type="text" label="Confirmar nueva contraseña:" option="hidden" enable="!eq(-1,)" default=""/>
|
<setting id="adult_aux_new_password2" type="text" label="Confirmar nueva contraseña:" option="hidden" enable="!eq(-1,)" default=""/>
|
||||||
|
|
||||||
|
|
||||||
<!--<setting type="sep"/>-->
|
<!--<setting type="sep"/>-->
|
||||||
<!--<setting label="Actualizaciones" type="lsep"/>-->
|
<!--<setting label="Actualizaciones" type="lsep"/>-->
|
||||||
<!--<setting id="plugin_updates_available" type="number" label="Number of updates available" default="0" visible="false"/>-->
|
<!--<setting id="plugin_updates_available" type="number" label="Number of updates available" default="0" visible="false"/>-->
|
||||||
@@ -30,13 +29,6 @@
|
|||||||
|
|
||||||
<!-- Path downloads and subtitles -->
|
<!-- Path downloads and subtitles -->
|
||||||
<category label="30501">
|
<category label="30501">
|
||||||
<!--setting id="subtitulo" type="bool" label="30021" default="false"/>
|
|
||||||
<setting id="subtitle_type" type="enum" lvalues="30432|30434|30433" label ="30431" enable ="eq(-1,true)" default="0"/>
|
|
||||||
<setting id="subtitlepath_folder" type="folder" source="" enable = "eq(-1,0)+eq(-2,true)" label="30435" default=""/>
|
|
||||||
<setting id="subtitlepath_file" type="file" source="" enable = "eq(-2,2)+eq(-3,true)" label="30436" default=""/>
|
|
||||||
<setting id="subtitlepath_keyboard" type="text" enable ="eq(-3,1)+eq(-4,true)" label="30437" default=""/>
|
|
||||||
<setting type="sep"/-->
|
|
||||||
|
|
||||||
<setting id="path_selection" type="enum" values="Escribir ruta|Examinar ruta" default="0" label="Tipo de ruta"/>
|
<setting id="path_selection" type="enum" values="Escribir ruta|Examinar ruta" default="0" label="Tipo de ruta"/>
|
||||||
<setting id="downloadpath" type="text" label="30017" default="" visible="eq(-1,0)"/>
|
<setting id="downloadpath" type="text" label="30017" default="" visible="eq(-1,0)"/>
|
||||||
<setting id="downloadpath" type="folder" label="30017" default="" visible="eq(-2,1)"/>
|
<setting id="downloadpath" type="folder" label="30017" default="" visible="eq(-2,1)"/>
|
||||||
@@ -54,14 +46,6 @@
|
|||||||
</category>
|
</category>
|
||||||
|
|
||||||
<category label="Otros"><!--30503 -->
|
<category label="Otros"><!--30503 -->
|
||||||
<!--
|
|
||||||
<setting label="Filtros" type="lsep"/>
|
|
||||||
<setting id="filter_servers" type="bool" label="30068" default="false"/>
|
|
||||||
|
|
||||||
<setting label="30071" type="lsep"/>
|
|
||||||
<setting id="whitelist" type="text" label="30069" enable="eq(-2,true)" default=""/>
|
|
||||||
<setting id="blacklist" type="text" label="30070" enable="eq(-3,true)" default=""/>
|
|
||||||
-->
|
|
||||||
<setting label="Info de películas/series en menú contextual" type="lsep"/>
|
<setting label="Info de películas/series en menú contextual" type="lsep"/>
|
||||||
<setting id="infoplus" type="bool" label="Mostrar opción Infoplus:" default="true"/>
|
<setting id="infoplus" type="bool" label="Mostrar opción Infoplus:" default="true"/>
|
||||||
<setting id="extended_info" type="bool" label="Mostrar opción ExtendedInfo (Necesario addon externo):" default="false"/>
|
<setting id="extended_info" type="bool" label="Mostrar opción ExtendedInfo (Necesario addon externo):" default="false"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user