fixes internos
This commit is contained in:
21
plugin.video.alfa/channels/autoplay.py
Executable file → Normal file
21
plugin.video.alfa/channels/autoplay.py
Executable file → Normal file
@@ -98,11 +98,14 @@ def start(itemlist, item):
|
||||
favorite_servers = []
|
||||
favorite_quality = []
|
||||
|
||||
# Guarda el valor actual de "Accion al seleccionar vídeo:" en preferencias
|
||||
user_config_setting = config.get_setting("default_action")
|
||||
# Guarda el valor actual de "Accion y Player Mode" en preferencias
|
||||
user_config_setting_action = config.get_setting("default_action")
|
||||
user_config_setting_player = config.get_setting("player_mode")
|
||||
# Habilita la accion "Ver en calidad alta" (si el servidor devuelve más de una calidad p.e. gdrive)
|
||||
if user_config_setting != 2:
|
||||
if user_config_setting_action != 2:
|
||||
config.set_setting("default_action", 2)
|
||||
if user_config_setting_player != 0:
|
||||
config.set_setting("player_mode", 0)
|
||||
|
||||
# Informa que AutoPlay esta activo
|
||||
platformtools.dialog_notification('AutoPlay Activo', '', sound=False)
|
||||
@@ -274,9 +277,11 @@ def start(itemlist, item):
|
||||
platformtools.dialog_notification("AutoPlay", "Nueva Calidad/Servidor disponible en la "
|
||||
"configuracion", sound=False)
|
||||
|
||||
# Restaura si es necesario el valor previo de "Accion al seleccionar vídeo:" en preferencias
|
||||
if user_config_setting != 2:
|
||||
config.set_setting("default_action", user_config_setting)
|
||||
# Restaura si es necesario el valor previo de "Accion y Player Mode" en preferencias
|
||||
if user_config_setting_action != 2:
|
||||
config.set_setting("default_action", user_config_setting_action)
|
||||
if user_config_setting_player != 0:
|
||||
config.set_setting("player_mode", user_config_setting_player)
|
||||
|
||||
# devuelve la lista de enlaces para la eleccion manual
|
||||
return itemlist
|
||||
@@ -524,12 +529,16 @@ def save(item, dict_data_saved):
|
||||
# Obtiene el nodo AUTOPLAY desde el json
|
||||
autoplay_node = jsontools.get_node_from_file('autoplay', 'AUTOPLAY')
|
||||
|
||||
new_config = dict_data_saved
|
||||
if not new_config['active']:
|
||||
new_config['language']=0
|
||||
channel_node = autoplay_node.get(item.from_channel)
|
||||
config.set_setting("filter_languages", dict_data_saved.pop("language"), item.from_channel)
|
||||
channel_node['settings'] = dict_data_saved
|
||||
|
||||
result, json_data = jsontools.update_node(autoplay_node, 'autoplay', 'AUTOPLAY')
|
||||
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -143,6 +143,13 @@ def render_items(itemlist, parent_item):
|
||||
# TODO: ¿Se puede eliminar esta linea? yo no he visto que haga ningun efecto.
|
||||
xbmcplugin.setPluginFanart(int(sys.argv[1]), os.path.join(config.get_runtime_path(), "fanart.jpg"))
|
||||
|
||||
# Esta opcion es para poder utilizar el xbmcplugin.setResolvedUrl()
|
||||
# if item.isPlayable == True or (config.get_setting("player_mode") == 1 and item.action == "play"):
|
||||
if config.get_setting("player_mode") == 1 and item.action == "play":
|
||||
if item.folder:
|
||||
item.folder = False
|
||||
listitem.setProperty('IsPlayable', 'true')
|
||||
|
||||
# Añadimos los infoLabels
|
||||
set_infolabels(listitem, item)
|
||||
|
||||
@@ -640,7 +647,7 @@ def get_dialogo_opciones(item, default_action, strm):
|
||||
# "Añadir a videoteca"
|
||||
opciones.append(config.get_localized_string(30161))
|
||||
|
||||
if default_action == "3":
|
||||
if default_action == 3:
|
||||
seleccion = len(opciones) - 1
|
||||
|
||||
# Busqueda de trailers en youtube
|
||||
@@ -800,11 +807,16 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
||||
# Reproduce
|
||||
xbmc_player = xbmc.Player()
|
||||
xbmc_player.play(playlist, xlistitem)
|
||||
|
||||
# elif config.get_setting("player_mode") == 1 or item.isPlayable:
|
||||
elif config.get_setting("player_mode") == 1:
|
||||
logger.info("mediaurl :" + mediaurl)
|
||||
logger.info("Tras setResolvedUrl")
|
||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=mediaurl))
|
||||
# si es un archivo de la videoteca enviar a marcar como visto
|
||||
if strm or item.strm_path:
|
||||
from platformcode import xbmc_videolibrary
|
||||
xbmc_videolibrary.mark_auto_as_watched(item)
|
||||
xlistitem.setPath(mediaurl)
|
||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xlistitem)
|
||||
|
||||
elif config.get_setting("player_mode") == 2:
|
||||
xbmc.executebuiltin("PlayMedia(" + mediaurl + ")")
|
||||
|
||||
0
plugin.video.alfa/resources/settings.xml
Executable file → Normal file
0
plugin.video.alfa/resources/settings.xml
Executable file → Normal file
Reference in New Issue
Block a user