Bugfix in API Handler prevented language id from being returned.

This commit is contained in:
echel0n 2014-03-12 20:38:14 -07:00
parent 047568ec76
commit 1da8cb148d
2 changed files with 11 additions and 10 deletions

View file

@ -47,15 +47,15 @@ class GenericIndexer(object):
INDEXER_API_PARMS[INDEXER_TVRAGE] = {'apikey': INDEXER_API_KEY[INDEXER_TVRAGE],
'language': 'en'}
config = {}
config['valid_languages'] = [
self.config = {}
self.config['valid_languages'] = [
"da", "fi", "nl", "de", "it", "es", "fr","pl", "hu","el","tr",
"ru","he","ja","pt","zh","cs","sl", "hr","ko","en","sv","no"]
config['langabbv_to_id'] = {'el': 20, 'en': 7, 'zh': 27,
self.config['langabbv_to_id'] = {'el': 20, 'en': 7, 'zh': 27,
'it': 15, 'cs': 28, 'es': 16, 'ru': 22, 'nl': 13, 'pt': 26, 'no': 9,
'tr': 21, 'pl': 18, 'fr': 17, 'hr': 31, 'de': 14, 'da': 10, 'fi': 11,
'hu': 19, 'ja': 25, 'he': 24, 'ko': 32, 'sv': 8, 'sl': 30}
self.api_parms = config['api_parms'] = INDEXER_API_PARMS[indexer]
self.name = config['name'] = INDEXER_NAME[indexer]
self.config['api_parms'] = INDEXER_API_PARMS[indexer]
self.config['name'] = INDEXER_NAME[indexer]

View file

@ -17,7 +17,7 @@
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
import os
import sickbeard
#import sickbeard
import generic
from lib.tvdb_api.tvdb_api import Tvdb
@ -26,15 +26,16 @@ from lib.tvrage_api.tvrage_api import TVRage
class indexerApi(generic.GenericIndexer):
def __init__(self, indexer=None, *args, **kwargs):
super(indexerApi, self).__init__(indexer)
self.name = self.config['name']
if indexer:
self.api_parms.update(**kwargs)
self.config['api_parms'].update(**kwargs)
if sickbeard.CACHE_DIR:
self.api_parms['cache'] = os.path.join(sickbeard.CACHE_DIR, indexer)
#if sickbeard.CACHE_DIR:
# self.api_parms['cache'] = os.path.join(sickbeard.CACHE_DIR, indexer)
# wrap the indexer API object and return it back
self._wrapped = eval(indexer)(*args, **self.api_parms)
self._wrapped = eval(indexer)(*args, **self.config['api_parms'])
def __getattr__(self, attr):
return getattr(self._wrapped, attr)