Merge pull request #452 from lopezvg/master

Kodi 18: mejoras de compatibilidad
This commit is contained in:
Alfa
2018-10-03 09:31:30 -05:00
committed by GitHub
6 changed files with 50 additions and 39 deletions

View File

@@ -3,11 +3,13 @@
"name": "CineCalidad",
"active": true,
"adult": false,
"language": ["cast", "lat"],
"language": ["cast", "lat", "por"],
"thumbnail": "https://s9.postimg.cc/58xyblsvj/cinecalidad.png",
"banner": "https://s32.postimg.cc/kihkdpx1x/banner_cinecalidad.png",
"categories": [
"movie",
"direct",
"vos",
"torrent"
],
"settings": [
@@ -15,9 +17,9 @@
"id": "include_in_global_search",
"type": "bool",
"label": "Incluir en busqueda global",
"default": false,
"enabled": false,
"visible": false
"default": true,
"enabled": true,
"visible": true
},
{
"id": "filter_languages",

View File

@@ -6,9 +6,7 @@
"language": ["cast", "lat"],
"thumbnail": "http://imgur.com/lmYQgOu.png",
"categories": [
"torrent",
"movie",
"tvshow",
"direct"
],
"settings": [

View File

@@ -460,6 +460,10 @@ def findvideos(item):
server.channel = "videolibrary"
server.nfo = item.nfo
server.strm_path = item.strm_path
#### Compatibilidad con Kodi 18: evita que se quede la ruedecedita dando vueltas en enlaces Directos
if server.action == 'play':
server.folder = False
# Se añade el nombre del canal si se desea
if config.get_setting("quit_channel_name", "videolibrary") == 0:

View File

@@ -486,7 +486,7 @@ def post_tmdb_seasons(item, itemlist):
Pasada para gestión del menú de Temporadas de una Serie
La clave de activación de este método es la variable item.season_colapse que pone el canal en el Item de Listado.
Esta variable tendrá que desaparecer cuando se aña a la Videoteca para que se analicen los episodios de la forma tradicional
Esta variable tendrá que desaparecer cuando se añada a la Videoteca para que se analicen los episodios de la forma tradicional
Repasa todos los episodios producidos en itemlist por "episodios" del canal para extraer las temporadas. Pone un título para Todas la Temps.
Crea un menú con las diferentes temporadas, así como con los títulos de Actualización de Título y de Añadir a Videoteca
@@ -1743,7 +1743,7 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
if ow_force == 'del': #Si es un borrado de estructuras erroneas, hacemos un proceso aparte
canal_des_def = canal_des #Si hay canal de sustitución para item.library_urls, lo usamos
if not canal_des_def and canal_org in item.library_urls and len(item.library_urls) == 1: #Si no, lo extraemos de la url
canal_des_def = scrapertools.find_single_match(item.library_urls[canal_org], 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').lower() #salvamos la url actual de la estructura a borrar
canal_des_def = scrapertools.find_single_match(item.library_urls[canal_org], 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').lower() #salvamos la url actual de la estructura a borrar
url_total = ''
if item.url:
url_total = item.url #Si existe item.url, lo salvamos para futuro uso
@@ -1795,7 +1795,7 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
channel_alt = channel_py
if channel_alt == 'videolibrary':
continue
if item.contentType == "list": #Si viene de Videolibrary, le cambiamos ya el canal
if item.contentType == "list": #Si viene de Videolibrary, le cambiamos ya el canal
if item.channel != channel_py:
item.channel = canal_des #Cambiamos el canal. Si es clone, lo hace el canal
continue #Salimos sin hacer nada más. item está casi vacío
@@ -1811,7 +1811,7 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
continue #... una intervención que afecte solo a una región
if ow_force == 'no' and it.library_urls: #Esta regla solo vale para findvideos...
continue #... salidmos si estamos actualizando
if lookup == True: #Queremos que el canal solo visualice sin migración?
if lookup == True: #Queremos que el canal solo visualice sin migración?
if ow_force != 'no':
overwrite = True #Avisamos que hay cambios
continue #Salimos sin tocar archivos
@@ -1820,7 +1820,7 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
url_total = item.url
elif not item.url and item.library_urls:
url_total = item.library_urls[canal_org]
url_total = url_total.replace(url_org, url_des) #reemplazamos una parte de url
url_total = url_total.replace(url_org, url_des) #reemplazamos una parte de url
url = ''
if patron1: #Hay expresión regex?
url += scrapertools.find_single_match(url_total, patron1) #La aplicamos a url
@@ -1856,7 +1856,7 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
item.channel = canal_des_def #Cambiamos el canal. Si es clone, lo hace el canal
if channel_alt == item.category.lower(): #Actualizamos la Categoría y si la tenía
item.category = item.channel.capitalize()
if ow_force_def == 'force': #Queremos que el canal revise la serie entera?
if ow_force_def == 'force' and item.contentType != 'movie': #Queremos que el canal revise la serie entera?
item.ow_force = '1' #Se lo decimos
if ow_force_def in ['force', 'auto']: #Sobreescribir la series?
overwrite = True #Sí, lo marcamos

View File

@@ -386,7 +386,7 @@ def play_from_library(item):
@param item: elemento con información
"""
logger.info()
# logger.debug("item: \n" + item.tostring('\n'))
#logger.debug("item: \n" + item.tostring('\n'))
import xbmcgui
import xbmcplugin
@@ -437,33 +437,39 @@ def play_from_library(item):
itemlist = reorder_itemlist(itemlist)
import time
p_dialog.update(100, '')
xbmc.sleep(500)
time.sleep(0.5)
p_dialog.close()
if len(itemlist) > 0:
# El usuario elige el mirror
opciones = []
for item in itemlist:
opciones.append(item.title)
while not xbmc.Monitor().abortRequested():
# El usuario elige el mirror
opciones = []
for item in itemlist:
opciones.append(item.title)
# Se abre la ventana de seleccion
if (item.contentSerieName != "" and
item.contentSeason != "" and
item.contentEpisodeNumber != ""):
cabecera = ("%s - %sx%s -- %s" %
(item.contentSerieName,
item.contentSeason,
item.contentEpisodeNumber,
config.get_localized_string(30163)))
else:
cabecera = config.get_localized_string(30163)
# Se abre la ventana de seleccion
if (item.contentSerieName != "" and
item.contentSeason != "" and
item.contentEpisodeNumber != ""):
cabecera = ("%s - %sx%s -- %s" %
(item.contentSerieName,
item.contentSeason,
item.contentEpisodeNumber,
config.get_localized_string(30163)))
else:
cabecera = config.get_localized_string(30163)
seleccion = platformtools.dialog_select(cabecera, opciones)
seleccion = platformtools.dialog_select(cabecera, opciones)
if seleccion == -1:
return
else:
item = videolibrary.play(itemlist[seleccion])[0]
platformtools.play_video(item)
if seleccion == -1:
return
else:
item = videolibrary.play(itemlist[seleccion])[0]
platformtools.play_video(item)
from channels import autoplay
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel):
break

View File

@@ -1080,12 +1080,13 @@ def play_torrent(item, xlistitem, mediaurl):
if seleccion > 1:
#### Compatibilidad con Kodi 18: evita cuelgues/cancelaciones cuando el .torrent se lanza desde pantalla convencional
if xbmc.getCondVisibility('Window.IsMedia'):
xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, xlistitem) #Preparamos el entorno para evitar error Kod1 18
xbmc.sleep(500) #Dejamos tiempo para que se ejecute
#if xbmc.getCondVisibility('Window.IsMedia'):
xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, xlistitem) #Preparamos el entorno para evitar error Kod1 18
time.sleep(0.5) #Dejamos tiempo para que se ejecute
mediaurl = urllib.quote_plus(item.url)
if ("quasar" in torrent_options[seleccion][1] or "elementum" in torrent_options[seleccion][1]) and item.infoLabels['tmdb_id']: #Llamada con más parámetros para completar el título
#Llamada con más parámetros para completar el título
if ("quasar" in torrent_options[seleccion][1] or "elementum" in torrent_options[seleccion][1]) and item.infoLabels['tmdb_id']:
if item.contentType == 'episode' and "elementum" not in torrent_options[seleccion][1]:
mediaurl += "&episode=%s&library=&season=%s&show=%s&tmdb=%s&type=episode" % (item.infoLabels['episode'], item.infoLabels['season'], item.infoLabels['tmdb_id'], item.infoLabels['tmdb_id'])
elif item.contentType == 'movie':