summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-07-04 12:07:11 -0400
committermorpheus65535 <[email protected]>2023-07-04 12:07:11 -0400
commitcfc8a914888acc1f45da80a27643378951179c47 (patch)
tree4c0df73f379398a674803fce6878c1f53fc46cfb
parentda7879a02a9c3e532e057b59c2b73715e7667945 (diff)
downloadbazarr-cfc8a914888acc1f45da80a27643378951179c47.tar.gz
bazarr-cfc8a914888acc1f45da80a27643378951179c47.zip
Fixed exception raised when get_episodesFiles_from_sonarr_api() doesn't return proper content. #2188v1.2.3-beta.1
-rw-r--r--bazarr/sonarr/sync/episodes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bazarr/sonarr/sync/episodes.py b/bazarr/sonarr/sync/episodes.py
index 5f5f952a8..d8e86bb2a 100644
--- a/bazarr/sonarr/sync/episodes.py
+++ b/bazarr/sonarr/sync/episodes.py
@@ -63,7 +63,7 @@ def sync_episodes(series_id=None, send_event=True):
episodeFiles = get_episodesFiles_from_sonarr_api(url=url_sonarr(), apikey_sonarr=apikey_sonarr,
series_id=seriesId['id'])
for episode in episodes:
- if episode['hasFile']:
+ if episodeFiles and episode['hasFile']:
item = [x for x in episodeFiles if x['id'] == episode['episodeFileId']]
if item:
episode['episodeFile'] = item[0]