Fixes and more fixes

This commit is contained in:
echel0n 2014-05-03 02:40:17 -07:00
parent 49027d6185
commit 48462f4baa

View file

@ -23,29 +23,29 @@ from indexer_config import initConfig, indexerConfig
class indexerApi(object): class indexerApi(object):
def __init__(self, indexerID=None): def __init__(self, indexerID=None):
self.indexerID = indexerID self.indexerID = int(indexerID)
def indexer(self, *args, **kwargs): def indexer(self, *args, **kwargs):
if self.indexerID: if self.indexerID:
return indexerConfig[int(self.indexerID)]['module'](*args, **kwargs) return indexerConfig[self.indexerID]['module'](*args, **kwargs)
@property @property
def config(self): def config(self):
if self.indexerID: if self.indexerID:
return indexerConfig[int(self.indexerID)] return indexerConfig[self.indexerID]
return initConfig return initConfig
@property @property
def name(self): def name(self):
if self.indexerID: if self.indexerID:
return indexerConfig[int(self.indexerID)]['name'] return indexerConfig[self.indexerID]['name']
@property @property
def api_params(self): def api_params(self):
if self.indexerID: if self.indexerID:
if sickbeard.CACHE_DIR: if sickbeard.CACHE_DIR:
indexerConfig[int(self.indexerID)]['api_params']['cache'] = os.path.join(sickbeard.CACHE_DIR, self.name) indexerConfig[self.indexerID]['api_params']['cache'] = os.path.join(sickbeard.CACHE_DIR, self.name)
return indexerConfig[int(self.indexerID)]['api_params'] return indexerConfig[self.indexerID]['api_params']
@property @property
def cache(self): def cache(self):