mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 18:03:37 +00:00
Bugfix in API Handler prevented language id from being returned.
This commit is contained in:
parent
047568ec76
commit
1da8cb148d
2 changed files with 11 additions and 10 deletions
|
@ -47,15 +47,15 @@ class GenericIndexer(object):
|
||||||
INDEXER_API_PARMS[INDEXER_TVRAGE] = {'apikey': INDEXER_API_KEY[INDEXER_TVRAGE],
|
INDEXER_API_PARMS[INDEXER_TVRAGE] = {'apikey': INDEXER_API_KEY[INDEXER_TVRAGE],
|
||||||
'language': 'en'}
|
'language': 'en'}
|
||||||
|
|
||||||
config = {}
|
self.config = {}
|
||||||
config['valid_languages'] = [
|
self.config['valid_languages'] = [
|
||||||
"da", "fi", "nl", "de", "it", "es", "fr","pl", "hu","el","tr",
|
"da", "fi", "nl", "de", "it", "es", "fr","pl", "hu","el","tr",
|
||||||
"ru","he","ja","pt","zh","cs","sl", "hr","ko","en","sv","no"]
|
"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,
|
'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,
|
'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}
|
'hu': 19, 'ja': 25, 'he': 24, 'ko': 32, 'sv': 8, 'sl': 30}
|
||||||
|
|
||||||
self.api_parms = config['api_parms'] = INDEXER_API_PARMS[indexer]
|
self.config['api_parms'] = INDEXER_API_PARMS[indexer]
|
||||||
self.name = config['name'] = INDEXER_NAME[indexer]
|
self.config['name'] = INDEXER_NAME[indexer]
|
|
@ -17,7 +17,7 @@
|
||||||
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
|
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import sickbeard
|
#import sickbeard
|
||||||
import generic
|
import generic
|
||||||
|
|
||||||
from lib.tvdb_api.tvdb_api import Tvdb
|
from lib.tvdb_api.tvdb_api import Tvdb
|
||||||
|
@ -26,15 +26,16 @@ from lib.tvrage_api.tvrage_api import TVRage
|
||||||
class indexerApi(generic.GenericIndexer):
|
class indexerApi(generic.GenericIndexer):
|
||||||
def __init__(self, indexer=None, *args, **kwargs):
|
def __init__(self, indexer=None, *args, **kwargs):
|
||||||
super(indexerApi, self).__init__(indexer)
|
super(indexerApi, self).__init__(indexer)
|
||||||
|
self.name = self.config['name']
|
||||||
|
|
||||||
if indexer:
|
if indexer:
|
||||||
self.api_parms.update(**kwargs)
|
self.config['api_parms'].update(**kwargs)
|
||||||
|
|
||||||
if sickbeard.CACHE_DIR:
|
#if sickbeard.CACHE_DIR:
|
||||||
self.api_parms['cache'] = os.path.join(sickbeard.CACHE_DIR, indexer)
|
# self.api_parms['cache'] = os.path.join(sickbeard.CACHE_DIR, indexer)
|
||||||
|
|
||||||
# wrap the indexer API object and return it back
|
# 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):
|
def __getattr__(self, attr):
|
||||||
return getattr(self._wrapped, attr)
|
return getattr(self._wrapped, attr)
|
||||||
|
|
Loading…
Reference in a new issue