diff options
author | morpheus65535 <[email protected]> | 2024-09-08 07:56:46 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2024-09-08 07:56:46 -0400 |
commit | 6ddfdfee6a64845fc0eab21b18ac56ad70d3e1f9 (patch) | |
tree | 169ef1be9b7f47206ae737f8c4cfe73928f69e1a | |
parent | f6c5ee6bfcbe28c77380b417562ba4deba2c658a (diff) | |
download | bazarr-6ddfdfee6a64845fc0eab21b18ac56ad70d3e1f9.tar.gz bazarr-6ddfdfee6a64845fc0eab21b18ac56ad70d3e1f9.zip |
Fixed series indexing when malformed alternate title is returned by Sonarr
-rw-r--r-- | bazarr/sonarr/sync/parser.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bazarr/sonarr/sync/parser.py b/bazarr/sonarr/sync/parser.py index 216a9d1f5..b985236fb 100644 --- a/bazarr/sonarr/sync/parser.py +++ b/bazarr/sonarr/sync/parser.py @@ -35,9 +35,11 @@ def seriesParser(show, action, tags_dict, language_profiles, serie_default_profi if image['coverType'] == 'fanart': fanart = image['url'].split('?')[0] - alternate_titles = None if show['alternateTitles'] is not None: - alternate_titles = str([item['title'] for item in show['alternateTitles']]) + alternate_titles = [item['title'] for item in show['alternateTitles'] if 'title' in item and item['title'] not + in [None, ''] and item["title"] != show["title"]] + else: + alternate_titles = [] tags = [d['label'] for d in tags_dict if d['id'] in show['tags']] @@ -64,7 +66,7 @@ def seriesParser(show, action, tags_dict, language_profiles, serie_default_profi 'audio_language': str(audio_language), 'sortTitle': show['sortTitle'], 'year': str(show['year']), - 'alternativeTitles': alternate_titles, + 'alternativeTitles': str(alternate_titles), 'tags': str(tags), 'seriesType': show['seriesType'], 'imdbId': imdbId, |