From 6e7a02f9e15818d757e5f531618d0c53cdc7ff8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Thu, 8 Oct 2020 09:32:13 -0400 Subject: [PATCH] Fix for #1143 --- bazarr/get_episodes.py | 5 ++++- bazarr/get_movies.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bazarr/get_episodes.py b/bazarr/get_episodes.py index c43d238a8..e1befcdbc 100644 --- a/bazarr/get_episodes.py +++ b/bazarr/get_episodes.py @@ -190,7 +190,10 @@ def sync_episodes(): "sonarrEpisodeId = ?" + get_exclusion_clause('series'), (altered_episode[0],), only_one=True) - episode_download_subtitles(data['sonarrEpisodeId']) + if data: + episode_download_subtitles(data['sonarrEpisodeId']) + else: + logging.debug("BAZARR skipping download for this movie as it is excluded.") else: logging.debug("BAZARR More than 5 episodes were added during this sync then we wont search for subtitles right now.") diff --git a/bazarr/get_movies.py b/bazarr/get_movies.py index 858e7324d..38b25bf16 100644 --- a/bazarr/get_movies.py +++ b/bazarr/get_movies.py @@ -273,7 +273,10 @@ def update_movies(): for altered_movie in altered_movies: data = database.execute("SELECT * FROM table_movies WHERE radarrId = ?" + get_exclusion_clause('movie'), (altered_movie[2],), only_one=True) - movies_download_subtitles(data['radarrId']) + if data: + movies_download_subtitles(data['radarrId']) + else: + logging.debug("BAZARR skipping download for this movie as it is excluded.") else: logging.debug("BAZARR More than 5 movies were added during this sync then we wont search for subtitles.")