settings only for active searchers

pull/1/head
DiMartinoXBMC 2015-07-17 23:16:00 +03:00
parent 56c3f89338
commit 49de8f6eb9
2 changed files with 13 additions and 3 deletions

View File

@ -250,7 +250,7 @@ class ControlCenter(AddonDialogWindow):
__settings__.openSettings() __settings__.openSettings()
def openSearcherSettings(self): def openSearcherSettings(self):
slist = Searchers().list('external').keys() slist=Searchers().activeExternal()
if len(slist)>0: if len(slist)>0:
ret = xbmcgui.Dialog().select(__language__(30418), slist) ret = xbmcgui.Dialog().select(__language__(30418), slist)
if ret > -1 and ret < len(slist): if ret > -1 and ret < len(slist):

View File

@ -1123,7 +1123,7 @@ class Searchers():
get_active = [] get_active = []
for searcher in self.list().keys(): for searcher in self.list().keys():
if self.old(searcher): get_active.append(searcher + '.py') if self.old(searcher): get_active.append(searcher + '.py')
print 'Active Searchers: ' + str(get_active) log('Active Searchers: ' + str(get_active))
return get_active return get_active
def searchWithSearcher(self, keyword, searcher): def searchWithSearcher(self, keyword, searcher):
@ -1163,6 +1163,12 @@ class Searchers():
xbmc.executebuiltin('Dialog.Close(all,true)') xbmc.executebuiltin('Dialog.Close(all,true)')
xbmc.executebuiltin('XBMC.ActivateWindow(Addonbrowser,addons://search/%s)' % ('Torrenter Searcher %s' % searcher)) xbmc.executebuiltin('XBMC.ActivateWindow(Addonbrowser,addons://search/%s)' % ('Torrenter Searcher %s' % searcher))
def activeExternal(self):
slist = []
for searcher in self.list('external').keys():
if self.old(searcher): slist.append(searcher)
return slist
def search(url, searchersList, isApi=None): def search(url, searchersList, isApi=None):
from threading import Thread from threading import Thread
@ -1171,6 +1177,10 @@ def search(url, searchersList, isApi=None):
except ImportError: except ImportError:
from queue import Queue from queue import Queue
num_threads=__settings__.getSetting('num_threads')
if num_threads not in ['',None] and int(num_threads)>0:
num_threads = int(num_threads)
else:
num_threads = 3 num_threads = 3
queue = Queue() queue = Queue()
result = {} result = {}