1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Bugfix for indexerApi improperly returning list of indexers

This commit is contained in:
echel0n 2014-03-26 19:01:53 -07:00
parent 8004685d3f
commit dd58028ba6
8 changed files with 19 additions and 17 deletions

View File

@ -30,7 +30,7 @@
#end if
<td>
<select name="indexer">
#for $curIndexer in $sickbeard.indexerApi.indexers().items():
#for $curIndexer in $sickbeard.indexerApi().indexers.items():
<option value="$curIndexer[0]" #if $curIndexer[0] == $indexer then "selected=\"selected\"" else ""#>$curIndexer[1]</option>
#end for
</select>

View File

@ -942,7 +942,7 @@ def get_show_by_name(name, showList, useIndexer=False):
return show
if useIndexer:
for indexer in sickbeard.indexerApi.indexers():
for indexer in sickbeard.indexerApi().indexers:
try:
lINDEXER_API_PARMS = sickbeard.indexerApi(indexer).api_params.copy()
lINDEXER_API_PARMS['custom_ui'] = classes.ShowListUI

View File

@ -20,6 +20,7 @@ import sickbeard
from indexer_config import initConfig, indexerConfig
class indexerApi(object):
def __init__(self, indexerID=None):
self.indexerID = indexerID
@ -51,6 +52,6 @@ class indexerApi(object):
if sickbeard.CACHE_DIR:
return self.api_params['cache']
@staticmethod
def indexers():
@property
def indexers(self):
return {k: v if k is 'id' else v['name'] for k, v in indexerConfig.items()}

View File

@ -284,7 +284,7 @@ class NameParser(object):
# see if we can find the name with a TVDB lookup
if check_indexer:
for cur_name in name_list:
for indexer in sickbeard.indexerApi.indexers():
for indexer in sickbeard.indexerApi().indexers:
try:
lINDEXER_API_PARMS = sickbeard.indexerApi(indexer).api_params.copy()

View File

@ -830,7 +830,7 @@ class PostProcessor(object):
# try to find the file info
indexer_id = season = episodes = None
for indexer in sickbeard.indexerApi.indexers():
for indexer in sickbeard.indexerApi().indexers:
self.indexer = int(indexer)
self._log(u"Searching " + sickbeard.indexerApi(self.indexer).name + ", trying to auto-detect Indexer for "

View File

@ -73,7 +73,7 @@ def retrieve_exceptions():
# exceptions are stored on github pages
for indexer in sickbeard.indexerApi.indexers():
for indexer in sickbeard.indexerApi().indexers:
logger.log(u"Checking for scene exception updates for " + sickbeard.indexerApi(indexer).name + "")
url = sickbeard.indexerApi(indexer).config['scene_url']

View File

@ -53,7 +53,7 @@ class ShowUpdater():
# clean out cache directory, remove everything > 12 hours old
if sickbeard.CACHE_DIR:
for indexer in sickbeard.indexerApi.indexers():
for indexer in sickbeard.indexerApi().indexers:
cache_dir = sickbeard.indexerApi(indexer).cache
logger.log(u"Trying to clean cache folder " + cache_dir)

View File

@ -1976,7 +1976,7 @@ class NewHomeAddShows:
keywords.insert(0, nameUTF8)
# check for indexer preset
indexers = sickbeard.indexerApi.indexers if not int(indexer) else [int(indexer or 0)]
indexers = sickbeard.indexerApi().indexers if not int(indexer) else [int(indexer or 0)]
# Query Indexers for each search term and build the list of results
for indexer in indexers():
@ -1994,7 +1994,8 @@ class NewHomeAddShows:
results += [[sickbeard.indexerApi(indexer).name, int(sickbeard.indexerApi(indexer).config['id']),
sickbeard.indexerApi(indexer).config["show_url"], int(x['id']), x['seriesname'],
x['firstaired']] for x in search if x['firstaired']]
except:continue
except:
continue
# remove duplicates
results = list(results for results, _ in itertools.groupby(results))
@ -2066,7 +2067,7 @@ class NewHomeAddShows:
# default to TVDB if indexer was not detected
if show_name and (indexer is None or indexer_id is None):
for idx in sickbeard.indexerApi.indexers():
for idx in sickbeard.indexerApi().indexers:
found_info = helpers.searchIndexerForShowID(show_name, idx, indexer_id)
if found_info:
# set indexer and indexer_id from found info