ultime chicche ricerca globale
This commit is contained in:
@@ -13,6 +13,7 @@ else: from concurrent_py2 import futures
|
|||||||
|
|
||||||
info_language = ["de", "en", "es", "fr", "it", "pt"] # from videolibrary.json
|
info_language = ["de", "en", "es", "fr", "it", "pt"] # from videolibrary.json
|
||||||
def_lang = info_language[config.get_setting("info_language", "videolibrary")]
|
def_lang = info_language[config.get_setting("info_language", "videolibrary")]
|
||||||
|
close_action = False
|
||||||
|
|
||||||
|
|
||||||
def busy(state):
|
def busy(state):
|
||||||
@@ -279,12 +280,18 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
logger.error('error importing/getting search items of ' + channel)
|
logger.error('error importing/getting search items of ' + channel)
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
|
def timer(self):
|
||||||
|
while self.searchActions:
|
||||||
|
self.COUNT.setText('%s/%s [%s"]' % (self.count, len(self.searchActions), int(time.time() - self.time) ))
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
def search(self):
|
def search(self):
|
||||||
|
logger.debug()
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.LOADING.setVisible(True)
|
self.LOADING.setVisible(True)
|
||||||
if self.thActions:
|
if self.thActions:
|
||||||
self.thActions.join()
|
self.thActions.join()
|
||||||
logger.debug()
|
Thread(target=self.timer).start()
|
||||||
|
|
||||||
with futures.ThreadPoolExecutor(max_workers=set_workers()) as executor:
|
with futures.ThreadPoolExecutor(max_workers=set_workers()) as executor:
|
||||||
for searchAction in self.searchActions:
|
for searchAction in self.searchActions:
|
||||||
@@ -361,7 +368,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
resultsList = item.getProperty('items')
|
resultsList = item.getProperty('items')
|
||||||
for result in valid:
|
for result in valid:
|
||||||
resultsList += result.tourl() + '|'
|
resultsList += result.tourl() + '|'
|
||||||
item.setProperty('items',resultsList)
|
item.setProperty('items', resultsList)
|
||||||
self.channels[0].setProperty('results', str(len(resultsList.split('|')) - 1))
|
self.channels[0].setProperty('results', str(len(resultsList.split('|')) - 1))
|
||||||
if self.CHANNELS.getSelectedPosition() == 0:
|
if self.CHANNELS.getSelectedPosition() == 0:
|
||||||
channelResults = self.CHANNELS.getListItem(0).getProperty('items').split('|')
|
channelResults = self.CHANNELS.getListItem(0).getProperty('items').split('|')
|
||||||
@@ -429,7 +436,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.PROGRESS = self.getControl(PROGRESS)
|
self.PROGRESS = self.getControl(PROGRESS)
|
||||||
self.COUNT = self.getControl(COUNT)
|
self.COUNT = self.getControl(COUNT)
|
||||||
self.MAINTITLE = self.getControl(MAINTITLE)
|
self.MAINTITLE = self.getControl(MAINTITLE)
|
||||||
self.MAINTITLE.setText(typo(config.get_localized_string(30993).replace('...','') % '"%s"' % self.item.text, 'bold'))
|
self.MAINTITLE.setText(typo(config.get_localized_string(30993).replace('...', '') % '"%s"' % self.item.text, 'bold'))
|
||||||
self.SEARCH = self.getControl(SEARCH)
|
self.SEARCH = self.getControl(SEARCH)
|
||||||
self.EPISODES = self.getControl(EPISODES)
|
self.EPISODES = self.getControl(EPISODES)
|
||||||
self.EPISODESLIST = self.getControl(EPISODESLIST)
|
self.EPISODESLIST = self.getControl(EPISODESLIST)
|
||||||
@@ -511,6 +518,8 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.Close()
|
self.Close()
|
||||||
|
|
||||||
def onClick(self, control_id):
|
def onClick(self, control_id):
|
||||||
|
global close_action
|
||||||
|
|
||||||
if self.RESULTS.getSelectedItem(): search = self.RESULTS.getSelectedItem().getProperty('search')
|
if self.RESULTS.getSelectedItem(): search = self.RESULTS.getSelectedItem().getProperty('search')
|
||||||
else: search = None
|
else: search = None
|
||||||
if control_id in [CHANNELS]:
|
if control_id in [CHANNELS]:
|
||||||
@@ -530,6 +539,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
|
|
||||||
elif control_id in [CLOSE]:
|
elif control_id in [CLOSE]:
|
||||||
self.Close()
|
self.Close()
|
||||||
|
close_action = True
|
||||||
|
|
||||||
elif control_id in [MENU]:
|
elif control_id in [MENU]:
|
||||||
self.context()
|
self.context()
|
||||||
@@ -546,7 +556,8 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
item = self.item.clone(mode='person_', discovery=self.persons[pos])
|
item = self.item.clone(mode='person_', discovery=self.persons[pos])
|
||||||
self.close()
|
self.close()
|
||||||
Search(item, self.moduleDict, self.searchActions)
|
Search(item, self.moduleDict, self.searchActions)
|
||||||
self.doModal()
|
if not close_action:
|
||||||
|
self.doModal()
|
||||||
else:
|
else:
|
||||||
item = Item().fromurl(self.RESULTS.getSelectedItem().getProperty('item'))
|
item = Item().fromurl(self.RESULTS.getSelectedItem().getProperty('item'))
|
||||||
if self.item.mode == 'movie': item.contentTitle = self.RESULTS.getSelectedItem().getLabel()
|
if self.item.mode == 'movie': item.contentTitle = self.RESULTS.getSelectedItem().getLabel()
|
||||||
@@ -563,7 +574,8 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
|
|
||||||
self.close()
|
self.close()
|
||||||
Search(item, self.moduleDict, self.searchActions)
|
Search(item, self.moduleDict, self.searchActions)
|
||||||
self.doModal()
|
if not close_action:
|
||||||
|
self.doModal()
|
||||||
|
|
||||||
elif control_id in [RESULTS, EPISODESLIST]:
|
elif control_id in [RESULTS, EPISODESLIST]:
|
||||||
busy(True)
|
busy(True)
|
||||||
|
|||||||
Reference in New Issue
Block a user