KoD 1.7.7
- fix di routine ai canali/server\n\n
This commit is contained in:
+12
-12
@@ -186,7 +186,7 @@ def peliculas(item, json='', key='', itemlist=[]):
|
||||
itlist = filterkey = []
|
||||
action = 'findvideos'
|
||||
|
||||
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes',
|
||||
if inspect.stack(0)[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes',
|
||||
'search'] and not item.filterkey and not item.disable_pagination:
|
||||
Pagination = int(defp) if defp.isdigit() else ''
|
||||
else:
|
||||
@@ -243,7 +243,7 @@ def peliculas(item, json='', key='', itemlist=[]):
|
||||
# if item.sort:
|
||||
# itemlist.sort(key=lambda x: x.title.lower(), reverse=False)
|
||||
if Pagination and len(itemlist) >= Pagination:
|
||||
if inspect.stack()[1][3] != 'get_newest':
|
||||
if inspect.stack(0)[1][3] != 'get_newest':
|
||||
item.title = support.typo(config.get_localized_string(30992), 'color kod bold')
|
||||
item.page = pag + 1
|
||||
item.thumbnail = support.thumb()
|
||||
@@ -279,13 +279,13 @@ def get_seasons(item):
|
||||
contentType='season' if show_seasons else 'tvshow',
|
||||
path=extra.path))
|
||||
|
||||
if inspect.stack()[2][3] in ['add_tvshow', 'get_episodes', 'update', 'find_episodes',
|
||||
if inspect.stack(0)[2][3] in ['add_tvshow', 'get_episodes', 'update', 'find_episodes',
|
||||
'get_newest'] or show_seasons == False:
|
||||
itlist = []
|
||||
for item in itemlist:
|
||||
itlist = episodios(item)
|
||||
itemlist = itlist
|
||||
if inspect.stack()[2][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes',
|
||||
if inspect.stack(0)[2][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes',
|
||||
'get_newest'] and defp and not item.disable_pagination:
|
||||
itemlist = pagination(item, itemlist)
|
||||
|
||||
@@ -322,7 +322,7 @@ def episodios(item, json='', key='', itemlist=[]):
|
||||
ep = 1
|
||||
season = infoLabels['season'] if 'season' in infoLabels else item.contentSeason if item.contentSeason else 1
|
||||
|
||||
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes',
|
||||
if inspect.stack(0)[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes',
|
||||
'search'] and not show_seasons:
|
||||
Pagination = int(defp) if defp.isdigit() else ''
|
||||
else:
|
||||
@@ -374,7 +374,7 @@ def episodios(item, json='', key='', itemlist=[]):
|
||||
path=item.path))
|
||||
|
||||
# if showseason
|
||||
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest', 'search']:
|
||||
if inspect.stack(0)[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest', 'search']:
|
||||
if show_seasons and not item.filterseason:
|
||||
itm.contentType = 'season'
|
||||
season_list = []
|
||||
@@ -399,15 +399,15 @@ def episodios(item, json='', key='', itemlist=[]):
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
|
||||
elif defp and inspect.stack()[1][3] not in ['get_seasons'] and not item.disable_pagination:
|
||||
elif defp and inspect.stack(0)[1][3] not in ['get_seasons'] and not item.disable_pagination:
|
||||
if Pagination and len(itemlist) >= Pagination:
|
||||
if inspect.stack()[1][3] != 'get_newest':
|
||||
if inspect.stack(0)[1][3] != 'get_newest':
|
||||
item.title = support.typo(config.get_localized_string(30992), 'color kod bold')
|
||||
item.page = pag + 1
|
||||
item.thumbnail = support.thumb()
|
||||
itemlist.append(item)
|
||||
|
||||
if inspect.stack()[1][3] not in ['get_seasons'] and not show_seasons:
|
||||
if inspect.stack(0)[1][3] not in ['get_seasons'] and not show_seasons:
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
return itemlist
|
||||
@@ -769,7 +769,7 @@ def set_extra_values(item, json, path):
|
||||
ret.subtitle = json[key]
|
||||
|
||||
if not ret.thumb:
|
||||
if 'get_search_menu' in inspect.stack()[1][3]:
|
||||
if 'get_search_menu' in inspect.stack(0)[1][3]:
|
||||
ret.thumb = get_thumb('search.png')
|
||||
else:
|
||||
ret.thumb = item.thumbnail
|
||||
@@ -830,7 +830,7 @@ def pagination(item, itemlist=[]):
|
||||
encoded_itemlist = []
|
||||
for it in itemlist:
|
||||
encoded_itemlist.append(it.tourl())
|
||||
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'search']:
|
||||
if inspect.stack(0)[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'search']:
|
||||
Pagination = int(defp) if defp.isdigit() else ''
|
||||
else:
|
||||
Pagination = ''
|
||||
@@ -843,7 +843,7 @@ def pagination(item, itemlist=[]):
|
||||
itlist.append(item)
|
||||
|
||||
if Pagination and len(itemlist) >= Pagination:
|
||||
if inspect.stack()[1][3] != 'get_newest':
|
||||
if inspect.stack(0)[1][3] != 'get_newest':
|
||||
itlist.append(
|
||||
Item(channel=item.channel,
|
||||
action='pagination',
|
||||
|
||||
@@ -416,7 +416,6 @@ class SearchWindow(xbmcgui.WindowXML):
|
||||
self.count += 1
|
||||
|
||||
return channel, valid, other if other else results
|
||||
self.update(channel, valid, other if other else results)
|
||||
# update_lock.release()
|
||||
|
||||
def makeItem(self, url):
|
||||
@@ -440,6 +439,7 @@ class SearchWindow(xbmcgui.WindowXML):
|
||||
return it
|
||||
|
||||
def update(self, channel, valid, results):
|
||||
update_lock.acquire()
|
||||
self.LOADING.setVisible(False)
|
||||
if self.exit:
|
||||
return
|
||||
@@ -462,7 +462,8 @@ class SearchWindow(xbmcgui.WindowXML):
|
||||
for result in valid:
|
||||
resultsList += result.tourl() + '|'
|
||||
item.setProperty('items', resultsList)
|
||||
self.channels[0].setProperty('results', str(len(resultsList.split('|')) - 1 ))
|
||||
res = len(resultsList.split('|'))
|
||||
self.channels[0].setProperty('results', str(res - 1 if res > 0 else 0))
|
||||
|
||||
if self.CHANNELS.getSelectedPosition() == 0:
|
||||
items = []
|
||||
@@ -487,7 +488,7 @@ class SearchWindow(xbmcgui.WindowXML):
|
||||
})
|
||||
for result in results:
|
||||
resultsList += result.tourl() + '|'
|
||||
item.setProperty('items',resultsList)
|
||||
item.setProperty('items', resultsList)
|
||||
self.results[name] = len(self.results)
|
||||
self.channels.append(item)
|
||||
else:
|
||||
@@ -497,7 +498,8 @@ class SearchWindow(xbmcgui.WindowXML):
|
||||
resultsList += result.tourl() + '|'
|
||||
item.setProperty('items',resultsList)
|
||||
logger.log(self.channels[int(self.results[name])])
|
||||
self.channels[int(self.results[name])].setProperty('results', str(len(resultsList.split('|')) - 1))
|
||||
res = len(resultsList.split('|'))
|
||||
self.channels[int(self.results[name])].setProperty('results', str(res - 1 if res > 0 else 0))
|
||||
pos = self.CHANNELS.getSelectedPosition()
|
||||
self.CHANNELS.reset()
|
||||
self.CHANNELS.addItems(self.channels)
|
||||
@@ -511,6 +513,7 @@ class SearchWindow(xbmcgui.WindowXML):
|
||||
if result: items.append(self.makeItem(result))
|
||||
self.RESULTS.reset()
|
||||
self.RESULTS.addItems(items)
|
||||
update_lock.release()
|
||||
|
||||
def onInit(self):
|
||||
self.time = time.time()
|
||||
@@ -689,6 +692,7 @@ class SearchWindow(xbmcgui.WindowXML):
|
||||
self.itemsResult = getattr(self.channel, item.action)(item)
|
||||
if self.itemsResult and self.itemsResult[0].server:
|
||||
from platformcode.launcher import findvideos
|
||||
busy(False)
|
||||
findvideos(self.item, self.itemsResult)
|
||||
return
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user