Altre Traduzioni
This commit is contained in:
@@ -21,8 +21,7 @@ else:
|
|||||||
import os, xbmc, xbmcgui, xbmcplugin
|
import os, xbmc, xbmcgui, xbmcplugin
|
||||||
|
|
||||||
from channelselector import get_thumb
|
from channelselector import get_thumb
|
||||||
from core import channeltools
|
from core import channeltools, trakt_tools, scrapertools
|
||||||
from core import trakt_tools, scrapertools
|
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import logger, config, unify
|
from platformcode import logger, config, unify
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class Recaptcha(xbmcgui.WindowXMLDialog):
|
|||||||
self.imagen = kwargs.get("imagen")
|
self.imagen = kwargs.get("imagen")
|
||||||
|
|
||||||
def onInit(self):
|
def onInit(self):
|
||||||
#### Compatibilidad con Kodi 18 ####
|
#### Kodi 18 compatibility ####
|
||||||
if config.get_platform(True)['num_version'] < 18:
|
if config.get_platform(True)['num_version'] < 18:
|
||||||
self.setCoordinateResolution(2)
|
self.setCoordinateResolution(2)
|
||||||
self.update_window()
|
self.update_window()
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
|||||||
|
|
||||||
Construction method:
|
Construction method:
|
||||||
SettingWindow(list_controls, dict_values, title, callback, item)
|
SettingWindow(list_controls, dict_values, title, callback, item)
|
||||||
Parametros:
|
Parameters:
|
||||||
list_controls: (list) Lista de controles a incluir en la ventana, segun el siguiente esquema:
|
list_controls: (list) List of controls to include in the window, according to the following scheme:
|
||||||
(opcional)list_controls= [
|
(opcional)list_controls= [
|
||||||
{'id': "nameControl1",
|
{'id': "nameControl1",
|
||||||
'type': "bool", # bool, text, list, label
|
'type': "bool", # bool, text, list, label
|
||||||
'label': "Control 1: tipo RadioButton",
|
'label': "Control 1: type RadioButton",
|
||||||
'color': '0xFFee66CC', # text color in hexadecimal ARGB format
|
'color': '0xFFee66CC', # text color in hexadecimal ARGB format
|
||||||
'default': True,
|
'default': True,
|
||||||
'enabled': True,
|
'enabled': True,
|
||||||
@@ -38,7 +38,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
|||||||
},
|
},
|
||||||
{'id': "nameControl2",
|
{'id': "nameControl2",
|
||||||
'type': "text", # bool, text, list, label
|
'type': "text", # bool, text, list, label
|
||||||
'label': "Control 2: tipo Cuadro de texto",
|
'label': "Control 2: type text box",
|
||||||
'color': '0xFFee66CC',
|
'color': '0xFFee66CC',
|
||||||
'default': "Valor por defecto",
|
'default': "Valor por defecto",
|
||||||
'hidden': False, # only for type = text Indicates whether to hide the text (for passwords)
|
'hidden': False, # only for type = text Indicates whether to hide the text (for passwords)
|
||||||
@@ -47,7 +47,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
|||||||
},
|
},
|
||||||
{'id': "nameControl3",
|
{'id': "nameControl3",
|
||||||
'type': "list", # bool, text, list, label
|
'type': "list", # bool, text, list, label
|
||||||
'label': "Control 3: tipo Lista",
|
'label': "Control 3: type List",
|
||||||
'color': '0xFFee66CC',
|
'color': '0xFFee66CC',
|
||||||
'default': 0, # Default value index in lvalues
|
'default': 0, # Default value index in lvalues
|
||||||
'enabled': True,
|
'enabled': True,
|
||||||
@@ -71,7 +71,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
|||||||
{
|
{
|
||||||
"id": "name_control_1",
|
"id": "name_control_1",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": "Control 1: tipo RadioButton",
|
"label": "Control 1: type RadioButton",
|
||||||
"default": false,
|
"default": false,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": true,
|
"visible": true,
|
||||||
@@ -80,8 +80,8 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
|||||||
{
|
{
|
||||||
"id": "name_control_2",
|
"id": "name_control_2",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"label": "Control 2: tipo Cuadro de texto",
|
"label": "Control 2: type text box",
|
||||||
"default": "Valor por defecto",
|
"default": "Default value",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": true,
|
"visible": true,
|
||||||
@@ -90,7 +90,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
|||||||
{
|
{
|
||||||
"id": "name_control_3",
|
"id": "name_control_3",
|
||||||
"type": "list",
|
"type": "list",
|
||||||
"label": "Control 3: tipo Lista",
|
"label": "Control 3: type List",
|
||||||
"default": 0,
|
"default": 0,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": true,
|
"visible": true,
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
|||||||
# logger.debug(str(data_in))
|
# logger.debug(str(data_in))
|
||||||
|
|
||||||
if self.listData:
|
if self.listData:
|
||||||
# Datos comunes a todos los listados
|
# Data common to all listings
|
||||||
infoLabels = self.scraper().get_infoLabels(origen=data_in)
|
infoLabels = self.scraper().get_infoLabels(origen=data_in)
|
||||||
|
|
||||||
if "original_language" in infoLabels:
|
if "original_language" in infoLabels:
|
||||||
@@ -84,78 +84,77 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
|||||||
|
|
||||||
def start(self, data, caption="Información del vídeo", item=None, scraper=Tmdb):
|
def start(self, data, caption="Información del vídeo", item=None, scraper=Tmdb):
|
||||||
"""
|
"""
|
||||||
Muestra una ventana con la info del vídeo. Opcionalmente se puede indicar el titulo de la ventana mendiante
|
It shows a window with the info of the video. Optionally, the title of the window can be indicated by means of the argument 'caption'.
|
||||||
el argumento 'caption'.
|
|
||||||
|
|
||||||
Si se pasa un item como argumento 'data' usa el scrapper Tmdb para buscar la info del vídeo
|
If an item is passed as the 'data' argument use the Tmdb scrapper to find the video info
|
||||||
En caso de peliculas:
|
In case of movies:
|
||||||
Coge el titulo de los siguientes campos (en este orden)
|
Take the title from the following fields (in this order)
|
||||||
1. contentTitle (este tiene prioridad 1)
|
1. contentTitle (this has priority 1)
|
||||||
2. title (este tiene prioridad 2)
|
2. title (this has priority 2)
|
||||||
El primero que contenga "algo" lo interpreta como el titulo (es importante asegurarse que el titulo este en
|
The first one containing "something" interprets it as the title (it is important to make sure that the title is in
|
||||||
su sitio)
|
your site)
|
||||||
|
|
||||||
En caso de series:
|
In case of series:
|
||||||
1. Busca la temporada y episodio en los campos contentSeason y contentEpisodeNumber
|
1. Find the season and episode in the contentSeason and contentEpisodeNumber fields
|
||||||
2. Intenta Sacarlo del titulo del video (formato: 1x01)
|
2. Try to remove it from the video title (format: 1x01)
|
||||||
|
|
||||||
Aqui hay dos opciones posibles:
|
Here are two possible options:
|
||||||
1. Tenemos Temporada y episodio
|
1. We have Season and episode
|
||||||
Muestra la información del capitulo concreto
|
Shows the information of the specific chapter
|
||||||
2. NO Tenemos Temporada y episodio
|
2. We DO NOT have Season and episode
|
||||||
En este caso muestra la informacion generica de la serie
|
In this case it shows the generic information of the series
|
||||||
|
|
||||||
Si se pasa como argumento 'data' un objeto InfoLabels(ver item.py) muestra en la ventana directamente
|
If an InfoLabels object (see item.py) is passed as an argument 'data' it shows in the window directly
|
||||||
la información pasada (sin usar el scrapper)
|
the past information (without using the scrapper)
|
||||||
Formato:
|
Format:
|
||||||
En caso de peliculas:
|
In case of movies:
|
||||||
infoLabels({
|
infoLabels ({
|
||||||
"type" : "movie",
|
"type" : "movie",
|
||||||
"title" : "Titulo de la pelicula",
|
"title": "Title of the movie",
|
||||||
"original_title" : "Titulo original de la pelicula",
|
"original_title": "Original movie title",
|
||||||
"date" : "Fecha de lanzamiento",
|
"date": "Release date",
|
||||||
"language" : "Idioma original de la pelicula",
|
"language": "Original language of the movie",
|
||||||
"rating" : "Puntuacion de la pelicula",
|
"rating": "Rating of the movie",
|
||||||
"votes" : "Numero de votos",
|
"votes": "Number of votes",
|
||||||
"genres" : "Generos de la pelicula",
|
"genres": "Genres of the movie",
|
||||||
"thumbnail" : "Ruta para el thumbnail",
|
"thumbnail": "Path for the thumbnail",
|
||||||
"fanart" : "Ruta para el fanart",
|
"fanart": "Route for the fanart",
|
||||||
"plot" : "Sinopsis de la pelicula"
|
"plot": "Synopsis of the movie"
|
||||||
}
|
}
|
||||||
En caso de series:
|
In case of series:
|
||||||
infoLabels({
|
infoLabels ({
|
||||||
"type" : "tv",
|
"type" : "tv",
|
||||||
"title" : "Titulo de la serie",
|
"title": "Title of the series",
|
||||||
"episode_title" : "Titulo del episodio",
|
"episode_title": "Episode title",
|
||||||
"date" : "Fecha de emision",
|
"date": "Date of issue",
|
||||||
"language" : "Idioma original de la serie",
|
"language": "Original language of the series",
|
||||||
"rating" : "Puntuacion de la serie",
|
"rating": "Punctuation of the series",
|
||||||
"votes" : "Numero de votos",
|
"votes": "Number of votes",
|
||||||
"genres" : "Generos de la serie",
|
"genres": "Genres of the series",
|
||||||
"thumbnail" : "Ruta para el thumbnail",
|
"thumbnail": "Path for the thumbnail",
|
||||||
"fanart" : "Ruta para el fanart",
|
"fanart": "Route for the fanart",
|
||||||
"plot" : "Sinopsis de la del episodio o de la serie",
|
"plot": "Synopsis of the episode or series",
|
||||||
"seasons" : "Numero de Temporadas",
|
"seasons": "Number of Seasons",
|
||||||
"season" : "Temporada",
|
"season": "Season",
|
||||||
"episodes" : "Numero de episodios de la temporada",
|
"episodes": "Number of episodes of the season",
|
||||||
"episode" : "Episodio"
|
"episode": "Episode"
|
||||||
}
|
}
|
||||||
Si se pasa como argumento 'data' un listado de InfoLabels() con la estructura anterior, muestra los botones
|
If a list of InfoLabels () with the previous structure is passed as the 'data' argument, it shows the buttons
|
||||||
'Anterior' y 'Siguiente' para ir recorriendo la lista. Ademas muestra los botones 'Aceptar' y 'Cancelar' que
|
'Previous' and 'Next' to scroll through the list. It also shows the 'Accept' and 'Cancel' buttons that
|
||||||
llamaran a la funcion 'callback' del canal desde donde se realiza la llamada pasandole como parametros el elemento
|
call the function 'callback' of the channel from where the call is made, passing the element as parameters
|
||||||
actual (InfoLabels()) o None respectivamente.
|
current (InfoLabels ()) or None respectively.
|
||||||
|
|
||||||
@param data: información para obtener datos del scraper.
|
@param data: information to get scraper data.
|
||||||
@type data: item, InfoLabels, list(InfoLabels)
|
@type data: item, InfoLabels, list(InfoLabels)
|
||||||
@param caption: titulo de la ventana.
|
@param caption: window title.
|
||||||
@type caption: str
|
@type caption: str
|
||||||
@param item: elemento del que se va a mostrar la ventana de información
|
@param item: item for which the information window is to be displayed
|
||||||
@type item: Item
|
@type item: Item
|
||||||
@param scraper: scraper que tiene los datos de las peliculas o series a mostrar en la ventana.
|
@param scraper: scraper that has the data of the movies or series to show in the window.
|
||||||
@type scraper: Scraper
|
@type scraper: Scraper
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Capturamos los parametros
|
# We capture the parameters
|
||||||
self.caption = caption
|
self.caption = caption
|
||||||
self.item = item
|
self.item = item
|
||||||
self.indexList = -1
|
self.indexList = -1
|
||||||
@@ -171,7 +170,7 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
|||||||
|
|
||||||
self.get_scraper_data(data)
|
self.get_scraper_data(data)
|
||||||
|
|
||||||
# Muestra la ventana
|
# Show window
|
||||||
self.doModal()
|
self.doModal()
|
||||||
return self.return_value
|
return self.return_value
|
||||||
|
|
||||||
@@ -184,19 +183,19 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.scraper = Tmdb
|
self.scraper = Tmdb
|
||||||
|
|
||||||
def onInit(self):
|
def onInit(self):
|
||||||
#### Compatibilidad con Kodi 18 ####
|
#### Kodi 18 compatibility ####
|
||||||
if config.get_platform(True)['num_version'] < 18:
|
if config.get_platform(True)['num_version'] < 18:
|
||||||
if xbmcgui.__version__ == "1.2":
|
if xbmcgui.__version__ == "1.2":
|
||||||
self.setCoordinateResolution(1)
|
self.setCoordinateResolution(1)
|
||||||
else:
|
else:
|
||||||
self.setCoordinateResolution(5)
|
self.setCoordinateResolution(5)
|
||||||
|
|
||||||
# Ponemos el título y las imagenes
|
# We put the title and the images
|
||||||
self.getControl(10002).setLabel(self.caption)
|
self.getControl(10002).setLabel(self.caption)
|
||||||
self.getControl(10004).setImage(self.result.get("fanart", ""))
|
self.getControl(10004).setImage(self.result.get("fanart", ""))
|
||||||
self.getControl(10005).setImage(self.result.get("thumbnail", "images/img_no_disponible.png"))
|
self.getControl(10005).setImage(self.result.get("thumbnail", "images/img_no_disponible.png"))
|
||||||
|
|
||||||
# Cargamos los datos para el formato pelicula
|
# We load the data for the movie format
|
||||||
if self.result.get("mediatype", "movie") == "movie":
|
if self.result.get("mediatype", "movie") == "movie":
|
||||||
self.getControl(10006).setLabel(config.get_localized_string(60377))
|
self.getControl(10006).setLabel(config.get_localized_string(60377))
|
||||||
self.getControl(10007).setLabel(self.result.get("title", "N/A"))
|
self.getControl(10007).setLabel(self.result.get("title", "N/A"))
|
||||||
@@ -211,7 +210,7 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.getControl(100016).setLabel(config.get_localized_string(60382))
|
self.getControl(100016).setLabel(config.get_localized_string(60382))
|
||||||
self.getControl(100017).setLabel(self.result.get("genre", "N/A"))
|
self.getControl(100017).setLabel(self.result.get("genre", "N/A"))
|
||||||
|
|
||||||
# Cargamos los datos para el formato serie
|
# We load the data for the serial format
|
||||||
else:
|
else:
|
||||||
self.getControl(10006).setLabel(config.get_localized_string(60383))
|
self.getControl(10006).setLabel(config.get_localized_string(60383))
|
||||||
self.getControl(10007).setLabel(self.result.get("title", "N/A"))
|
self.getControl(10007).setLabel(self.result.get("title", "N/A"))
|
||||||
@@ -235,7 +234,7 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.getControl(100020).setLabel(config.get_localized_string(60387))
|
self.getControl(100020).setLabel(config.get_localized_string(60387))
|
||||||
self.getControl(100021).setLabel(self.result.get("date", "N/A"))
|
self.getControl(100021).setLabel(self.result.get("date", "N/A"))
|
||||||
|
|
||||||
# Sinopsis
|
# Synopsis
|
||||||
if self.result['plot']:
|
if self.result['plot']:
|
||||||
self.getControl(100022).setLabel(config.get_localized_string(60388))
|
self.getControl(100022).setLabel(config.get_localized_string(60388))
|
||||||
self.getControl(100023).setText(self.result.get("plot", "N/A"))
|
self.getControl(100023).setText(self.result.get("plot", "N/A"))
|
||||||
@@ -243,20 +242,20 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.getControl(100022).setLabel("")
|
self.getControl(100022).setLabel("")
|
||||||
self.getControl(100023).setText("")
|
self.getControl(100023).setText("")
|
||||||
|
|
||||||
# Cargamos los botones si es necesario
|
# We load the buttons if necessary
|
||||||
self.getControl(10024).setVisible(self.indexList > -1) # Grupo de botones
|
self.getControl(10024).setVisible(self.indexList > -1) # Button group
|
||||||
self.getControl(ID_BUTTON_PREVIOUS).setEnabled(self.indexList > 0) # Anterior
|
self.getControl(ID_BUTTON_PREVIOUS).setEnabled(self.indexList > 0) # Previous
|
||||||
|
|
||||||
if self.listData:
|
if self.listData:
|
||||||
m = len(self.listData)
|
m = len(self.listData)
|
||||||
else:
|
else:
|
||||||
m = 1
|
m = 1
|
||||||
|
|
||||||
self.getControl(ID_BUTTON_NEXT).setEnabled(self.indexList + 1 != m) # Siguiente
|
self.getControl(ID_BUTTON_NEXT).setEnabled(self.indexList + 1 != m) # Following
|
||||||
self.getControl(100029).setLabel("(%s/%s)" % (self.indexList + 1, m)) # x/m
|
self.getControl(100029).setLabel("(%s/%s)" % (self.indexList + 1, m)) # x/m
|
||||||
|
|
||||||
# Ponemos el foco en el Grupo de botones, si estuviera desactivado "Anterior" iria el foco al boton "Siguiente"
|
# We put the focus in the Group of buttons, if "Previous" was deactivated the focus would go to the "Next" button
|
||||||
# si "Siguiente" tb estuviera desactivado pasara el foco al botón "Cancelar"
|
# if "Next" tb is deactivated it will pass the focus to the "Cancel" button
|
||||||
self.setFocus(self.getControl(10024))
|
self.setFocus(self.getControl(10024))
|
||||||
|
|
||||||
return self.return_value
|
return self.return_value
|
||||||
@@ -331,6 +330,6 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
|||||||
# Down
|
# Down
|
||||||
elif action == 4:
|
elif action == 4:
|
||||||
self.setFocus(self.getControl(ID_BUTTON_OK))
|
self.setFocus(self.getControl(ID_BUTTON_OK))
|
||||||
# Pulsa ESC o Atrás, simula click en boton cancelar
|
# Press ESC or Back, simulate click on cancel button
|
||||||
if action in [10, 92]:
|
if action in [10, 92]:
|
||||||
self.onClick(ID_BUTTON_CANCEL)
|
self.onClick(ID_BUTTON_CANCEL)
|
||||||
|
|||||||
Reference in New Issue
Block a user