mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-11-10 17:13:35 +08:00
Fixed compatibility with the latest nightly version of Sonarr v4.
This commit is contained in:
parent
fca1c9656e
commit
0fb928675c
2 changed files with 14 additions and 1 deletions
|
@ -29,7 +29,10 @@ def seriesParser(show, action, tags_dict, serie_default_profile, audio_profiles)
|
||||||
if get_sonarr_info.is_legacy():
|
if get_sonarr_info.is_legacy():
|
||||||
audio_language = profile_id_to_language(show['qualityProfileId'], audio_profiles)
|
audio_language = profile_id_to_language(show['qualityProfileId'], audio_profiles)
|
||||||
else:
|
else:
|
||||||
audio_language = profile_id_to_language(show['languageProfileId'], audio_profiles)
|
if 'languageProfileId' in show:
|
||||||
|
audio_language = profile_id_to_language(show['languageProfileId'], audio_profiles)
|
||||||
|
else:
|
||||||
|
audio_language = []
|
||||||
|
|
||||||
tags = [d['label'] for d in tags_dict if d['id'] in show['tags']]
|
tags = [d['label'] for d in tags_dict if d['id'] in show['tags']]
|
||||||
|
|
||||||
|
@ -96,6 +99,12 @@ def episodeParser(episode):
|
||||||
if isinstance(item, dict):
|
if isinstance(item, dict):
|
||||||
if 'name' in item:
|
if 'name' in item:
|
||||||
audio_language.append(item['name'])
|
audio_language.append(item['name'])
|
||||||
|
elif 'languages' in episode['episodeFile'] and len(episode['episodeFile']['languages']):
|
||||||
|
items = episode['episodeFile']['languages']
|
||||||
|
if isinstance(items, list):
|
||||||
|
for item in items:
|
||||||
|
if 'name' in item:
|
||||||
|
audio_language.append(item['name'])
|
||||||
else:
|
else:
|
||||||
audio_language = TableShows.get(TableShows.sonarrSeriesId == episode['seriesId']).audio_language
|
audio_language = TableShows.get(TableShows.sonarrSeriesId == episode['seriesId']).audio_language
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,10 @@ def get_profile_list():
|
||||||
logging.exception("BAZARR Error trying to get profiles from Sonarr.")
|
logging.exception("BAZARR Error trying to get profiles from Sonarr.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# return an empty list when using Sonarr v4 that do not support series languages profiles anymore
|
||||||
|
if profiles_json.status_code == 404:
|
||||||
|
return profiles_list
|
||||||
|
|
||||||
# Parsing data returned from Sonarr
|
# Parsing data returned from Sonarr
|
||||||
if get_sonarr_info.is_legacy():
|
if get_sonarr_info.is_legacy():
|
||||||
for profile in profiles_json.json():
|
for profile in profiles_json.json():
|
||||||
|
|
Loading…
Reference in a new issue