KoD 1.5.2
- Migliorato Menu Rapido\n- Rimosso Menu Laterale\n- Fix Youtube\n- Fix Visualizza collegamenti della videoteca come pop-up\n- Riorganizzata sezione Aiuto\n- Reinserito canale tantifilm\n
This commit is contained in:
+20
-37
@@ -65,7 +65,7 @@ QUALITYTAG = 505
|
||||
EPISODESLIST = 200
|
||||
SERVERLIST = 300
|
||||
|
||||
class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
class SearchWindow(xbmcgui.WindowXML):
|
||||
def start(self, item, moduleDict={}, searchActions=[]):
|
||||
logger.debug()
|
||||
self.exit = False
|
||||
@@ -83,6 +83,8 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
self.searchActions = searchActions
|
||||
self.thread = None
|
||||
self.selected = False
|
||||
self.pos = 0
|
||||
selfeppos = 0
|
||||
self.items = []
|
||||
|
||||
if not searchActions:
|
||||
@@ -479,8 +481,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
global close_action
|
||||
action = action.getId()
|
||||
focus = self.getFocusId()
|
||||
if action in [FULLSCREEN]:
|
||||
self.playmonitor()
|
||||
|
||||
if action in [CONTEXT] and focus in [RESULTS, EPISODESLIST, SERVERLIST]:
|
||||
self.context()
|
||||
|
||||
@@ -500,7 +501,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
self.RESULTS.addItems(items)
|
||||
self.RESULTS.selectItem(subpos)
|
||||
|
||||
elif action in [DOWN] and focus in [BACK, CLOSE, MENU]:
|
||||
elif (action in [DOWN] and focus in [BACK, CLOSE, MENU]) or focus not in [BACK, CLOSE, MENU, SERVERLIST, EPISODESLIST, RESULTS, CHANNELS]:
|
||||
if self.SERVERS.isVisible(): self.setFocusId(SERVERLIST)
|
||||
elif self.EPISODES.isVisible(): self.setFocusId(EPISODESLIST)
|
||||
elif self.RESULTS.isVisible(): self.setFocusId(RESULTS)
|
||||
@@ -556,10 +557,10 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
self.actors()
|
||||
elif search == 'persons':
|
||||
item = self.item.clone(mode='person_', discovery=self.persons[pos])
|
||||
self.close()
|
||||
# self.close()
|
||||
Search(item, self.moduleDict, self.searchActions)
|
||||
if not close_action:
|
||||
self.doModal()
|
||||
if close_action:
|
||||
self.close
|
||||
else:
|
||||
item = Item().fromurl(self.RESULTS.getSelectedItem().getProperty('item'))
|
||||
if self.item.mode == 'movie': item.contentTitle = self.RESULTS.getSelectedItem().getLabel()
|
||||
@@ -574,10 +575,10 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
self.RESULTS.setVisible(True)
|
||||
self.PROGRESS.setVisible(False)
|
||||
|
||||
self.close()
|
||||
# self.close()
|
||||
Search(item, self.moduleDict, self.searchActions)
|
||||
if not close_action:
|
||||
self.doModal()
|
||||
if close_action:
|
||||
self.close()
|
||||
|
||||
elif control_id in [RESULTS, EPISODESLIST]:
|
||||
busy(True)
|
||||
@@ -586,7 +587,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
self.pos = self.RESULTS.getSelectedPosition()
|
||||
item = Item().fromurl(self.RESULTS.getSelectedItem().getProperty('item'))
|
||||
else:
|
||||
self.pos = self.EPISODESLIST.getSelectedPosition()
|
||||
self.eppos = self.EPISODESLIST.getSelectedPosition()
|
||||
item_url = self.EPISODESLIST.getSelectedItem().getProperty('item')
|
||||
if item_url:
|
||||
item = Item().fromurl(item_url)
|
||||
@@ -663,14 +664,12 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
|
||||
if config.get_setting('autoplay'):
|
||||
busy(False)
|
||||
self.playmonitor()
|
||||
|
||||
else:
|
||||
self.episodes = self.itemsResult if self.itemsResult else []
|
||||
self.itemsResult = []
|
||||
ep = []
|
||||
for item in self.episodes:
|
||||
# if item.action == 'findvideos':
|
||||
it = xbmcgui.ListItem(item.title)
|
||||
it.setProperty('item', item.tourl())
|
||||
ep.append(it)
|
||||
@@ -688,9 +687,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
|
||||
elif control_id in [SERVERLIST]:
|
||||
server = Item().fromurl(self.getControl(control_id).getSelectedItem().getProperty('item'))
|
||||
return self.playmonitor(server)
|
||||
# server.globalsearch = True
|
||||
# return run(server)
|
||||
return self.play(server)
|
||||
|
||||
def Back(self):
|
||||
self.getControl(QUALITYTAG).setText('')
|
||||
@@ -701,7 +698,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
else:
|
||||
self.Focus(SEARCH)
|
||||
self.setFocusId(RESULTS)
|
||||
self.RESULTS.selectItem(self.pos)
|
||||
self.RESULTS.selectItem(self.eppos)
|
||||
elif self.EPISODES.isVisible():
|
||||
self.episodes = []
|
||||
self.Focus(SEARCH)
|
||||
@@ -740,23 +737,9 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||
if index > 0: xbmc.executebuiltin(context_commands[index])
|
||||
|
||||
|
||||
def playmonitor(self, server=None):
|
||||
if server:
|
||||
platformtools.prevent_busy(server)
|
||||
server.window = True
|
||||
server.globalsearch = True
|
||||
if server in ['torrent']: Thread(target=run, args=[server]).start()
|
||||
else: run(server)
|
||||
try:
|
||||
while not platformtools.is_playing() or not xbmc.Player().getTime() > 0:
|
||||
xbmc.sleep(500)
|
||||
self.close()
|
||||
xbmc.sleep(500)
|
||||
while xbmcgui.getCurrentWindowId() in [12005, 12006]:
|
||||
xbmc.sleep(500)
|
||||
if platformtools.is_playing():
|
||||
xbmc.sleep(300)
|
||||
xbmc.executebuiltin('Action(Fullscreen)')
|
||||
self.doModal()
|
||||
except:
|
||||
return
|
||||
def play(self, server=None):
|
||||
platformtools.prevent_busy(server)
|
||||
server.window = True
|
||||
server.globalsearch = True
|
||||
return run(server)
|
||||
|
||||
|
||||
+6
-145
@@ -1,40 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
|
||||
from channelselector import get_thumb
|
||||
from core.item import Item
|
||||
from platformcode import config, logger, platformtools
|
||||
|
||||
if config.is_xbmc():
|
||||
|
||||
import xbmcgui
|
||||
|
||||
class TextBox(xbmcgui.WindowXMLDialog):
|
||||
""" Create a skinned textbox window """
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.title = kwargs.get('title')
|
||||
self.text = kwargs.get('text')
|
||||
self.doModal()
|
||||
|
||||
def onInit(self):
|
||||
try:
|
||||
self.getControl(5).setText(self.text)
|
||||
self.getControl(1).setLabel(self.title)
|
||||
except:
|
||||
pass
|
||||
|
||||
def onClick(self, control_id):
|
||||
pass
|
||||
|
||||
def onFocus(self, control_id):
|
||||
pass
|
||||
|
||||
def onAction(self, action):
|
||||
# self.close()
|
||||
if action in [xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]:
|
||||
self.close()
|
||||
from platformcode import config, logger
|
||||
|
||||
guideUrl = "https://github.com/kodiondemand/addon/wiki/Guida-alle-funzioni-di-Kod"
|
||||
|
||||
def mainlist(item):
|
||||
logger.debug()
|
||||
@@ -44,119 +13,11 @@ def mainlist(item):
|
||||
itemlist.append(Item(title=config.get_localized_string(707429), channel="setting", action="report_menu",
|
||||
thumbnail=get_thumb("error.png"), viewmode="list",folder=True))
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action="", title=config.get_localized_string(60447),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
itemlist.append(Item(action="open_browser", title=config.get_localized_string(60447),
|
||||
thumbnail=get_thumb("help.png"), url=guideUrl, plot=guideUrl,
|
||||
folder=False))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(60449),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra="onoff_canales"))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(60450),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra="trakt_sync"))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(60451),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra="buscador_juntos"))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(60452),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra="tiempo_enlaces"))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(60453),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra="prob_busquedacont"))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(60454),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra="canal_fallo"))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(70280),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra="prob_torrent"))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(60455),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra="prob_bib"))
|
||||
itemlist.append(Item(channel=item.channel, action="faq",
|
||||
title=config.get_localized_string(60456),
|
||||
thumbnail=get_thumb("help.png"),
|
||||
folder=False, extra=""))
|
||||
itemlist.append(Item(channel="setting", action="check_quickfixes", folder=False, thumbnail=get_thumb("update.png"),
|
||||
title=config.get_localized_string(30001), plot=config.get_addon_version(with_fix=True)))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def faq(item):
|
||||
|
||||
if item.extra == "onoff_canales":
|
||||
respuesta = platformtools.dialog_yesno(config.get_localized_string(60457), config.get_localized_string(60458))
|
||||
if respuesta == 1:
|
||||
from specials import setting
|
||||
setting.conf_tools(Item(extra='channels_onoff'))
|
||||
|
||||
elif item.extra == "trakt_sync":
|
||||
respuesta = platformtools.dialog_yesno(config.get_localized_string(60457), config.get_localized_string(60459))
|
||||
if respuesta == 1:
|
||||
from specials import videolibrary
|
||||
videolibrary.channel_config(Item(channel='videolibrary'))
|
||||
|
||||
elif item.extra == "tiempo_enlaces":
|
||||
respuesta = platformtools.dialog_yesno(config.get_localized_string(60457), config.get_localized_string(60460))
|
||||
if respuesta == 1:
|
||||
from specials import videolibrary
|
||||
videolibrary.channel_config(Item(channel='videolibrary'))
|
||||
|
||||
elif item.extra == "prob_busquedacont":
|
||||
title = config.get_localized_string(60461) % item.title[6:]
|
||||
text = config.get_localized_string(60462)
|
||||
|
||||
return TextBox("DialogTextViewer.xml", os.getcwd(), "Default", title=title, text=text)
|
||||
|
||||
elif item.extra == "canal_fallo":
|
||||
title = config.get_localized_string(60461) % item.title[6:]
|
||||
text = config.get_localized_string(60463)
|
||||
|
||||
return TextBox("DialogTextViewer.xml", os.getcwd(), "Default", title=title, text=text)
|
||||
|
||||
elif item.extra == "prob_bib":
|
||||
platformtools.dialog_ok(config.get_localized_string(60457), # To check
|
||||
config.get_localized_string(60464))
|
||||
|
||||
respuesta = platformtools.dialog_yesno(config.get_localized_string(60457),
|
||||
config.get_localized_string(60465))
|
||||
if respuesta == 1:
|
||||
itemlist = []
|
||||
from specials import setting
|
||||
new_item = Item(channel="setting", action="submenu_tools", folder=True)
|
||||
itemlist.extend(setting.submenu_tools(new_item))
|
||||
return itemlist
|
||||
|
||||
elif item.extra == "prob_torrent":
|
||||
title = config.get_localized_string(60461) % item.title[6:]
|
||||
text = config.get_localized_string(70279)
|
||||
|
||||
return TextBox("DialogTextViewer.xml", os.getcwd(), "Default", title=title, text=text)
|
||||
|
||||
elif item.extra == "buscador_juntos":
|
||||
respuesta = platformtools.dialog_yesno(config.get_localized_string(60457), config.get_localized_string(60466))
|
||||
if respuesta == 1:
|
||||
from specials import search
|
||||
search.settings("")
|
||||
|
||||
elif item.extra == "report_error":
|
||||
import xbmc
|
||||
if config.get_platform(True)['num_version'] < 14:
|
||||
log_name = "xbmc.log"
|
||||
else:
|
||||
log_name = "kodi.log"
|
||||
ruta = xbmc.translatePath("special://logpath") + log_name
|
||||
title = config.get_localized_string(60461) % item.title[6:]
|
||||
text = config.get_localized_string(60467) % ruta
|
||||
|
||||
return TextBox("DialogTextViewer.xml", os.getcwd(), "Default", title=title, text=text)
|
||||
|
||||
else:
|
||||
platformtools.dialog_ok(config.get_localized_string(60457), # To check "Tag telegram"
|
||||
config.get_localized_string(60468))
|
||||
|
||||
|
||||
+14
-20
@@ -26,7 +26,7 @@ from datetime import datetime
|
||||
|
||||
from core.item import Item
|
||||
from platformcode import config, logger, platformtools
|
||||
from core import filetools, jsontools
|
||||
from core import filetools, jsontools, support
|
||||
|
||||
|
||||
def fechahora_actual():
|
||||
@@ -189,30 +189,24 @@ def mainlist(item):
|
||||
for i_perfil, perfil in enumerate(alfav.user_favorites):
|
||||
context = []
|
||||
|
||||
context.append({'title': config.get_localized_string(70533), 'channel': item.channel, 'action': 'editar_perfil_titulo',
|
||||
'i_perfil': i_perfil})
|
||||
context.append({'title': config.get_localized_string(70534), 'channel': item.channel, 'action': 'eliminar_perfil',
|
||||
'i_perfil': i_perfil})
|
||||
context.append({'title': config.get_localized_string(70533), 'channel': item.channel, 'action': 'editar_perfil_titulo', 'i_perfil': i_perfil})
|
||||
context.append({'title': config.get_localized_string(70534), 'channel': item.channel, 'action': 'eliminar_perfil', 'i_perfil': i_perfil})
|
||||
|
||||
if i_perfil > 0:
|
||||
context.append({'title': config.get_localized_string(70535), 'channel': item.channel, 'action': 'mover_perfil',
|
||||
'i_perfil': i_perfil, 'direccion': 'top'})
|
||||
context.append({'title': config.get_localized_string(70536), 'channel': item.channel, 'action': 'mover_perfil',
|
||||
'i_perfil': i_perfil, 'direccion': 'arriba'})
|
||||
context.append({'title': config.get_localized_string(70535), 'channel': item.channel, 'action': 'mover_perfil', 'i_perfil': i_perfil, 'direccion': 'top'})
|
||||
context.append({'title': config.get_localized_string(70536), 'channel': item.channel, 'action': 'mover_perfil', 'i_perfil': i_perfil, 'direccion': 'arriba'})
|
||||
if i_perfil < last_i:
|
||||
context.append({'title': config.get_localized_string(70537), 'channel': item.channel, 'action': 'mover_perfil',
|
||||
'i_perfil': i_perfil, 'direccion': 'abajo'})
|
||||
context.append({'title': config.get_localized_string(70538), 'channel': item.channel, 'action': 'mover_perfil',
|
||||
'i_perfil': i_perfil, 'direccion': 'bottom'})
|
||||
context.append({'title': config.get_localized_string(70537), 'channel': item.channel, 'action': 'mover_perfil', 'i_perfil': i_perfil, 'direccion': 'abajo'})
|
||||
context.append({'title': config.get_localized_string(70538), 'channel': item.channel, 'action': 'mover_perfil', 'i_perfil': i_perfil, 'direccion': 'bottom'})
|
||||
|
||||
plot = str(len(perfil['items'])) + " " + config.get_localized_string(70723)
|
||||
itemlist.append(Item(channel=item.channel, action='mostrar_perfil', title=perfil['title'], plot=plot, i_perfil=i_perfil, context=context))
|
||||
itemlist.append(Item(channel=item.channel, action='mostrar_perfil', title=perfil['title'], plot=plot, i_perfil=i_perfil, context=context, thumbnail=support.thumb('mylink.png')))
|
||||
|
||||
itemlist.append(item.clone(action='crear_perfil', title=config.get_localized_string(70542), folder=False))
|
||||
|
||||
itemlist.append(item.clone(action='mainlist_listas', title=config.get_localized_string(70603)))
|
||||
|
||||
return itemlist
|
||||
return support.thumb(itemlist)
|
||||
|
||||
|
||||
def mostrar_perfil(item):
|
||||
@@ -230,13 +224,13 @@ def mostrar_perfil(item):
|
||||
for i_enlace, enlace in enumerate(alfav.user_favorites[i_perfil]['items']):
|
||||
|
||||
it = Item().fromurl(enlace)
|
||||
it.context = [ {'title': '[COLOR blue]'+config.get_localized_string(70617)+'[/COLOR]', 'channel': item.channel, 'action': 'acciones_enlace',
|
||||
it.context = [ {'title': config.get_localized_string(70617), 'channel': item.channel, 'action': 'acciones_enlace',
|
||||
'i_enlace': i_enlace, 'i_perfil': i_perfil} ]
|
||||
|
||||
it.plot += '[CR][CR][COLOR blue]' + config.get_localized_string(70724) + ':[/COLOR] ' + it.channel + ' [COLOR blue]' + config.get_localized_string(60266) + ':[/COLOR] ' + it.action
|
||||
if it.extra != '': it.plot += ' [COLOR blue]Extra:[/COLOR] ' + it.extra
|
||||
it.plot += '[CR][COLOR blue]Url:[/COLOR] ' + it.url if isinstance(it.url, str) else '...'
|
||||
if it.date_added != '': it.plot += '[CR][COLOR blue]' + config.get_localized_string(70469) + ':[/COLOR] ' + it.date_added
|
||||
it.plot += '[CR][CR]' + config.get_localized_string(70724) + ': ' + it.channel + ' ' + config.get_localized_string(60266) + ': ' + it.action
|
||||
if it.extra != '': it.plot += ' Extra: ' + it.extra
|
||||
it.plot += '[CR]Url: ' + it.url if isinstance(it.url, str) else '...'
|
||||
if it.date_added != '': it.plot += '[CR]' + config.get_localized_string(70469) + ': ' + it.date_added
|
||||
|
||||
# If it is not a url, nor does it have the system path, convert the path since it will have been copied from another device.
|
||||
# It would be more optimal if the conversion was done with an import menu, but at the moment it is controlled in run-time.
|
||||
|
||||
+11
-11
@@ -246,15 +246,15 @@ def novedades(item):
|
||||
|
||||
list_canales, any_active = get_channels_list()
|
||||
|
||||
if config.is_xbmc():
|
||||
from platformcode import side_menu
|
||||
if mode=='silent' and any_active and len(list_canales[item.extra]) > 0:
|
||||
side_menu.set_menu_settings(item)
|
||||
aux_list=[]
|
||||
for canal in list_canales[item.extra]:
|
||||
if len(aux_list)<2:
|
||||
aux_list.append(canal)
|
||||
list_canales[item.extra]=aux_list
|
||||
# if config.is_xbmc():
|
||||
# from platformcode import side_menu
|
||||
# if mode=='silent' and any_active and len(list_canales[item.extra]) > 0:
|
||||
# side_menu.set_menu_settings(item)
|
||||
# aux_list=[]
|
||||
# for canal in list_canales[item.extra]:
|
||||
# if len(aux_list)<2:
|
||||
# aux_list.append(canal)
|
||||
# list_canales[item.extra]=aux_list
|
||||
|
||||
if mode == 'set_cache':
|
||||
list_canales[item.extra] = list_canales[item.extra][2:]
|
||||
@@ -290,7 +290,7 @@ def novedades(item):
|
||||
|
||||
# Multi Thread mode: wait for all threads to finish
|
||||
if multithread:
|
||||
pendent = [a for a in threads if a.isAlive()]
|
||||
pendent = [a for a in threads if a.is_alive()]
|
||||
t = float(100) / len(pendent)
|
||||
while pendent:
|
||||
index = (len(threads) - len(pendent)) + 1
|
||||
@@ -308,7 +308,7 @@ def novedades(item):
|
||||
break
|
||||
|
||||
time.sleep(0.5)
|
||||
pendent = [a for a in threads if a.isAlive()]
|
||||
pendent = [a for a in threads if a.is_alive()]
|
||||
if mode == 'normal':
|
||||
mensaje = config.get_localized_string(60522) % (len(list_newest), time.time() - start_time)
|
||||
progreso.update(100, mensaje)
|
||||
|
||||
+17
-11
@@ -21,7 +21,7 @@ from core.item import Item
|
||||
from core import tmdb, scrapertools, channeltools, filetools, jsontools, servertools
|
||||
from channelselector import get_thumb
|
||||
from platformcode import logger, config, platformtools, unify
|
||||
from core.support import typo
|
||||
from core.support import typo, thumb
|
||||
import xbmcgui
|
||||
|
||||
import gc
|
||||
@@ -697,11 +697,18 @@ def discover_list(item):
|
||||
year = scrapertools.find_single_match(release, r'(\d{4})')
|
||||
|
||||
if not item.cast_ or (item.cast_ and (int(year) <= int(datetime.datetime.today().year))):
|
||||
new_item = Item(channel='search', title=typo(title, 'bold'), infoLabels=elem,
|
||||
action='channel_search', text=title,
|
||||
thumbnail=thumbnail, fanart=fanart,
|
||||
context='', mode=mode, contentType=mode,
|
||||
release_date=year)
|
||||
if config.get_setting('new_search'):
|
||||
new_item = Item(channel='globalsearch', title=typo(title, 'bold'), infoLabels=elem,
|
||||
action='Search', text=title,
|
||||
thumbnail=thumbnail, fanart=fanart,
|
||||
context='', mode='search', type = mode, contentType=mode,
|
||||
release_date=year, folder = False)
|
||||
else:
|
||||
new_item = Item(channel='search', title=typo(title, 'bold'), infoLabels=elem,
|
||||
action='channel_search', text=title,
|
||||
thumbnail=thumbnail, fanart=fanart,
|
||||
context='', mode=mode, contentType=mode,
|
||||
release_date=year)
|
||||
|
||||
if tvshow:
|
||||
new_item.contentSerieName = title
|
||||
@@ -718,14 +725,13 @@ def discover_list(item):
|
||||
|
||||
elif len(result) > 19 and item.discovery:
|
||||
item.discovery['page'] = str(int(item.discovery['page']) + 1)
|
||||
itemlist.append(Item(channel=item.channel, action='discover_list', title=config.get_localized_string(70065),
|
||||
list_type=item.list_type, discovery=item.discovery, text_color='gold'))
|
||||
itemlist.append(Item(channel=item.channel, action='discover_list', title=typo(config.get_localized_string(30992), 'color kod bold'),
|
||||
list_type=item.list_type, discovery=item.discovery, thumbnail=thumb()))
|
||||
elif len(result) > 19:
|
||||
next_page = str(int(item.page) + 1)
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action='discover_list', title=config.get_localized_string(70065),
|
||||
list_type=item.list_type, search_type=item.search_type, mode=item.mode, page=next_page,
|
||||
text_color='gold'))
|
||||
itemlist.append(Item(channel=item.channel, action='discover_list', title=typo(config.get_localized_string(30992), 'color kod bold'),
|
||||
list_type=item.list_type, search_type=item.search_type, mode=item.mode, page=next_page, thumbnail=thumb()))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -371,47 +371,6 @@ def settings(item):
|
||||
config.open_settings()
|
||||
|
||||
|
||||
def submenu_tools(item):
|
||||
logger.debug()
|
||||
itemlist = list()
|
||||
|
||||
# Custom tools
|
||||
import os
|
||||
channel_custom = os.path.join(config.get_runtime_path(), 'channels', 'custom.py')
|
||||
if not filetools.exists(channel_custom):
|
||||
user_custom = os.path.join(config.get_data_path(), 'custom.py')
|
||||
if filetools.exists(user_custom):
|
||||
filetools.copy(user_custom, channel_custom, silent=True)
|
||||
if filetools.exists(channel_custom):
|
||||
itemlist.append(Item(channel='custom', action='mainlist', title='Custom Channel'))
|
||||
|
||||
itemlist.append(Item(channel=CHANNELNAME, action="check_quickfixes", folder=False,
|
||||
title=config.get_localized_string(30001), plot=config.get_addon_version(with_fix=True)))
|
||||
# itemlist.append(Item(channel=CHANNELNAME, action="update_quasar", folder=False,
|
||||
# title=config.get_localized_string(70569)))
|
||||
itemlist.append(Item(channel=CHANNELNAME, action="", title="", folder=False,
|
||||
thumbnail=get_thumb("setting_0.png")))
|
||||
|
||||
itemlist.append(Item(channel=CHANNELNAME, title=config.get_localized_string(60564) + ":", action="", folder=False,
|
||||
text_bold=True, thumbnail=get_thumb("channels.png")))
|
||||
itemlist.append(Item(channel=CHANNELNAME, title=config.get_localized_string(60565), action="conf_tools",
|
||||
folder=True, extra="lib_check_datajson", thumbnail=get_thumb("channels.png")))
|
||||
|
||||
if config.get_videolibrary_support():
|
||||
itemlist.append(Item(channel=CHANNELNAME, action="", title="", folder=False,
|
||||
thumbnail=get_thumb("setting_0.png")))
|
||||
itemlist.append(Item(channel=CHANNELNAME, title=config.get_localized_string(60566) + ":", action="", folder=False,
|
||||
text_bold=True, thumbnail=get_thumb("videolibrary.png")))
|
||||
itemlist.append(Item(channel=CHANNELNAME, action="restore_tools", folder=False,
|
||||
thumbnail=get_thumb("videolibrary.png"),
|
||||
title="- " + config.get_localized_string(60567)))
|
||||
itemlist.append(Item(channel="videolibrary", action="update_videolibrary", folder=False,
|
||||
thumbnail=get_thumb("videolibrary.png"),
|
||||
title="- " + config.get_localized_string(60568)))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def check_quickfixes(item):
|
||||
logger.debug()
|
||||
|
||||
|
||||
@@ -358,11 +358,11 @@ try:
|
||||
self.control_list.addItems(self.items)
|
||||
self.setFocus(self.control_list)
|
||||
def onClick(self, id):
|
||||
global window_select, result
|
||||
# Cancel button y [X]
|
||||
if id == 7:
|
||||
window_select[-1].close()
|
||||
if id == 5:
|
||||
global window_select, result
|
||||
self.result = "_no_video"
|
||||
result = "no_video"
|
||||
self.close()
|
||||
|
||||
+21
-9
@@ -408,9 +408,14 @@ def details(item):
|
||||
|
||||
title = item.contentType.replace("movie", config.get_localized_string(70283)).replace("tvshow", "serie")
|
||||
# Search by titles chosen language and / or original version and Spanish
|
||||
itemlist.append(item.clone(channel='search', action="new_search", title=config.get_localized_string(70069) % (title, item.contentTitle), search_text=item.contentTitle, mode=item.contentType))
|
||||
if item.infoLabels['originaltitle'] and item.contentTitle != item.infoLabels['originaltitle']:
|
||||
itemlist.append(item.clone(channel='search', action="search", search_text=item.infoLabels['originaltitle'], title=config.get_localized_string(70070) % item.infoLabels['originaltitle'], mode=item.contentType))
|
||||
if config.get_setting('new_search'):
|
||||
itemlist.append(item.clone(channel='globalsearch', action="Search", title=config.get_localized_string(70069) % (title, item.contentTitle), search_text=item.contentTitle, mode='search', type=item.contentType))
|
||||
if item.infoLabels['originaltitle'] and item.contentTitle != item.infoLabels['originaltitle']:
|
||||
itemlist.append(item.clone(channel='globalsearch', action="Search", search_text=item.infoLabels['originaltitle'], title=config.get_localized_string(70070) % item.infoLabels['originaltitle'], mode='search', type=item.contentType))
|
||||
else:
|
||||
itemlist.append(item.clone(channel='search', action="new_search", title=config.get_localized_string(70069) % (title, item.contentTitle), search_text=item.contentTitle, mode=item.contentType))
|
||||
if item.infoLabels['originaltitle'] and item.contentTitle != item.infoLabels['originaltitle']:
|
||||
itemlist.append(item.clone(channel='search', action="search", search_text=item.infoLabels['originaltitle'], title=config.get_localized_string(70070) % item.infoLabels['originaltitle'], mode=item.contentType))
|
||||
|
||||
# if langt != "es" and langt != "en" and item.infoLabels["tmdb_id"]:
|
||||
# tmdb_lang = Tmdb(id_Tmdb=item.infoLabels["tmdb_id"], tipo=item.args, idioma_searching=def_lang)
|
||||
@@ -2035,7 +2040,7 @@ def top_mal(item):
|
||||
# data = re.sub(r"\n|\r|\t| ", "", data)
|
||||
# data = re.sub(r"\s{2}", " ", data)
|
||||
|
||||
patron = r'<td class="title al va-t word-break"><a.*?href="([^"]+)"[^>]+><img.*?src="([^"]+).*?<div class="di-ib clearfix">.*?href.*?>([^<]+)<.*?<div class="information di-ib mt4">(.*?)<br>.*?(\d{4}|-).*?<span class="text.*?>(.*?)</span>'
|
||||
patron = r'<td class="title al va-t word-break">\s*<a.*?href="([^"]+)"[^>]+>\s*<img.*?src="([^"]+).*?<div class="di-ib clearfix">.*?href.*?>([^<]+)<.*?<div class="information di-ib mt4">(.*?)<br>.*?(\d{4}|-).*?<span class="text.*?>(.*?)</span>'
|
||||
matches = match(item, patron=patron)
|
||||
for url, thumbnail, title, info, year, rating in matches.matches:
|
||||
new_item = item.clone(action="details_mal", url=url)
|
||||
@@ -2155,13 +2160,20 @@ def details_mal(item):
|
||||
if item.infoLabels['fanart']: item.fanart = item.infoLabels['fanart']
|
||||
if item.infoLabels['thumbnail']: item.thumbnail = item.infoLabels['thumbnail']
|
||||
if not item.thumbnail: item.thumbnail = match(data, patron=r'/pics">.*?<img src="([^"]+)"').match.replace(".jpg", "l.jpg")
|
||||
if config.get_setting('new_search'):
|
||||
itemlist.append(item.clone(action="Search", channel='globalsearch', title=config.get_localized_string(70350) % title_mal, text=title_mal, mode=item.args.replace("tv", "tvshow"), contentType=item.args.replace("tv", "tvshow"), thumbnail=thumb('search')))
|
||||
if item.infoLabels["title"] and title_mal != item.infoLabels["title"]:
|
||||
itemlist.append(item.clone(action="Search", channel='globalsearch', search_text=item.infoLabels["title"], title=config.get_localized_string(70351) % item.infoLabels["title"], mode=item.args.replace("tv", "tvshow"), contentType=item.args.replace("tv", "tvshow"), thumbnail=thumb('search')))
|
||||
|
||||
itemlist.append(item.clone(action="new_search", channel='search', title=config.get_localized_string(70350) % title_mal, search_text=title_mal, args=item.args.replace("tv", "anime"), thumbnail=thumb('search')))
|
||||
if item.infoLabels["title"] and title_mal != item.infoLabels["title"]:
|
||||
itemlist.append(item.clone(action="new_search", channel='search', search_text=item.infoLabels["title"], title=config.get_localized_string(70351) % item.infoLabels["title"], thumbnail=thumb('search')))
|
||||
if eng_title and item.contentTitle != eng_title and title_mal != eng_title:
|
||||
itemlist.append(item.clone(action="Search", channel='globalsearch', search_text=eng_title, title=config.get_localized_string(70352) % eng_title, mode=item.args.replace("tv", "tvshow"), contentType=item.args.replace("tv", "tvshow"), thumbnail=thumb('search')))
|
||||
else:
|
||||
itemlist.append(item.clone(action="new_search", channel='search', title=config.get_localized_string(70350) % title_mal, search_text=title_mal, args=item.args.replace("tv", "anime"), thumbnail=thumb('search')))
|
||||
if item.infoLabels["title"] and title_mal != item.infoLabels["title"]:
|
||||
itemlist.append(item.clone(action="new_search", channel='search', search_text=item.infoLabels["title"], title=config.get_localized_string(70351) % item.infoLabels["title"], thumbnail=thumb('search')))
|
||||
|
||||
if eng_title and item.contentTitle != eng_title and title_mal != eng_title:
|
||||
itemlist.append(item.clone(action="new_search", channel='search', search_text=eng_title, title=config.get_localized_string(70352) % eng_title, thumbnail=thumb('search')))
|
||||
if eng_title and item.contentTitle != eng_title and title_mal != eng_title:
|
||||
itemlist.append(item.clone(action="new_search", channel='search', search_text=eng_title, title=config.get_localized_string(70352) % eng_title, thumbnail=thumb('search')))
|
||||
|
||||
if item_tmdb.args == "tv" and ob_tmdb.result:
|
||||
itemlist.append(item.clone(action="info_seasons", title=config.get_localized_string(70067) % item.infoLabels["number_of_seasons"], thumbnail=thumb('info')))
|
||||
|
||||
@@ -64,15 +64,17 @@ def list_tvshows(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
lista = []
|
||||
tvshows_path = []
|
||||
# tvshows_path = []
|
||||
|
||||
# We get all the tvshow.nfo from the SERIES video library recursively
|
||||
for root, folders, files in filetools.walk(videolibrarytools.TVSHOWS_PATH):
|
||||
for f in folders:
|
||||
tvshows_path += [filetools.join(root, f, "tvshow.nfo")]
|
||||
# # We get all the tvshow.nfo from the SERIES video library recursively
|
||||
# for root, folders, files in filetools.walk(videolibrarytools.TVSHOWS_PATH):
|
||||
# for f in folders:
|
||||
# tvshows_path += [filetools.join(root, f, "tvshow.nfo")]
|
||||
|
||||
root = videolibrarytools.TVSHOWS_PATH
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
for tvshow_path in tvshows_path:
|
||||
for folder in filetools.listdir(root):
|
||||
tvshow_path = filetools.join(root, folder, "tvshow.nfo")
|
||||
item_tvshow, value = executor.submit(get_results, tvshow_path, root, 'tvshow').result()
|
||||
# verify the existence of the channels
|
||||
if item_tvshow.library_urls and len(item_tvshow.library_urls) > 0:
|
||||
@@ -394,7 +396,10 @@ def findvideos(item):
|
||||
logger.debug("Unable to search for videos due to lack of parameters")
|
||||
return []
|
||||
|
||||
content_title = str(item.contentSeason) + 'x' + (str(item.contentEpisodeNumber) if item.contentEpisodeNumber > 9 else '0' + str(item.contentEpisodeNumber))
|
||||
if item.contentEpisodeNumber:
|
||||
content_title = str(item.contentSeason) + 'x' + (str(item.contentEpisodeNumber) if item.contentEpisodeNumber > 9 else '0' + str(item.contentEpisodeNumber))
|
||||
else:
|
||||
content_title = item.contentTitle.strip().lower()
|
||||
if item.contentType == 'movie':
|
||||
item.strm_path = filetools.join(videolibrarytools.MOVIES_PATH, item.strm_path)
|
||||
path_dir = filetools.dirname(item.strm_path)
|
||||
@@ -1127,8 +1132,8 @@ def add_download_items(item, itemlist):
|
||||
thumbnail=thumb('downloads'),
|
||||
parent=item.tourl())
|
||||
if item.action == 'findvideos':
|
||||
if item.contentType == 'episode':
|
||||
downloadItem.title = typo(config.get_localized_string(60356), "color kod bold")
|
||||
if item.contentType != 'movie':
|
||||
downloadItem.title = '{} {}'.format(typo(config.get_localized_string(60356), "color kod bold"), item.title)
|
||||
else: # film
|
||||
downloadItem.title = typo(config.get_localized_string(60354), "color kod bold")
|
||||
downloadItem.downloadItemlist = [i.tourl() for i in itemlist]
|
||||
|
||||
Reference in New Issue
Block a user