Skip to content

Commit

Permalink
Fix searching show, episodes and fanart by language code. (#8784)
Browse files Browse the repository at this point in the history
* Fix searching show, episodes and fanart by language code.

* Update changelog
  • Loading branch information
p0psicles authored Nov 29, 2020
1 parent f04b0c6 commit ffc1eca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#### Fixes
- Provider Nyaa.si: Correct the category that is used for anime searches ([8777](https://github.com/pymedusa/Medusa/pull/8777))
- Indexer TMDB: Fix adding show using an alternative language ([8784](https://github.com/pymedusa/Medusa/pull/8784))

-----

Expand Down
4 changes: 2 additions & 2 deletions medusa/indexers/tmdb/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _get_show_by_id(self, tmdb_id, request_language='en', extra_info=None):
log.debug('Getting all show data for {0}', tmdb_id)
try:
results = self.tmdb.TV(tmdb_id).info(
language='{0},null'.format(request_language),
language='{0}'.format(request_language),
append_to_response=extra_info
)
except RequestException as error:
Expand Down Expand Up @@ -353,7 +353,7 @@ def _parse_images(self, tmdb_id):
_images = {}

# Let's get the different type of images available for this series
params = {'include_image_language': '{search_language},null'.format(search_language=self.config['language'])}
params = {'include_image_language': '{search_language}'.format(search_language=self.config['language'])}

try:
images = self.tmdb.TV(tmdb_id).images(params=params)
Expand Down
8 changes: 4 additions & 4 deletions medusa/tv/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ def get_indexer_api(self, options=None):
indexer_api = indexerApi(self.indexer.id)
indexer_api_params = indexer_api.api_params.copy()

if options and options.get('language') is not None:
indexer_api_params['language'] = options['language']
if options and options.get('lang') is not None:
indexer_api_params['language'] = options['lang']

log.debug('{indexer_name}: {indexer_params!r}', {
'indexer_name': indexerApi(self.indexer.id).name,
'indexer_params': indexer_api_params
})

return indexer_api.indexer(**indexer_api.api_params)
return indexer_api.indexer(**indexer_api_params)

def __bool__(self):
"""Magic method."""
Expand Down Expand Up @@ -1719,7 +1719,7 @@ def configure(self, queue_item):
self.anime = options['anime'] if options.get('anime') is not None else app.ANIME_DEFAULT
self.scene = options['scene'] if options.get('scene') is not None else app.SCENE_DEFAULT
self.paused = options['paused'] if options.get('paused') is not None else False
self.lang = options['language'] if options.get('language') is not None else app.INDEXER_DEFAULT_LANGUAGE
self.lang = options['lang'] if options.get('lang') is not None else app.INDEXER_DEFAULT_LANGUAGE
self.show_lists = options['show_lists'] if options.get('show_lists') is not None else app.SHOWLISTS_DEFAULT

if options.get('default_status') is not None:
Expand Down

0 comments on commit ffc1eca

Please sign in to comment.