summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2021-08-29 20:27:15 -0400
committermorpheus65535 <[email protected]>2021-08-29 20:27:15 -0400
commit3b4e81db5eee45a73b7cee8b371e1f0649b01037 (patch)
tree2ea15d57950ee163678e4f8c3d0e4e5a1b3490b4
parent84eecec98ec76a2a1eb34173728c4b87e1f3f351 (diff)
downloadbazarr-3b4e81db5eee45a73b7cee8b371e1f0649b01037.tar.gz
bazarr-3b4e81db5eee45a73b7cee8b371e1f0649b01037.zip
Fixed a search loop issue with missing subtitles for episodes. #1521
-rw-r--r--bazarr/get_subtitle.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py
index 9f9f6212b..02956ad17 100644
--- a/bazarr/get_subtitle.py
+++ b/bazarr/get_subtitle.py
@@ -988,7 +988,7 @@ def movies_download_subtitles(no):
hide_progress(id='movie_search_progress_{}'.format(no))
-def wanted_download_subtitles(sonarr_series_id):
+def wanted_download_subtitles(sonarr_episode_id):
episodes_details = TableEpisodes.select(TableEpisodes.path,
TableEpisodes.missing_subtitles,
TableEpisodes.sonarrEpisodeId,
@@ -998,7 +998,7 @@ def wanted_download_subtitles(sonarr_series_id):
TableEpisodes.failedAttempts,
TableShows.title)\
.join(TableShows, on=(TableEpisodes.sonarrSeriesId == TableShows.sonarrSeriesId))\
- .where((TableEpisodes.sonarrSeriesId == sonarr_series_id))\
+ .where((TableEpisodes.sonarrEpisodeId == sonarr_episode_id))\
.dicts()
episodes_details = list(episodes_details)
@@ -1162,6 +1162,7 @@ def wanted_search_missing_subtitles_series():
conditions = [(TableEpisodes.missing_subtitles != '[]')]
conditions += get_exclusion_clause('series')
episodes = TableEpisodes.select(TableEpisodes.sonarrSeriesId,
+ TableEpisodes.sonarrEpisodeId,
TableShows.tags,
TableEpisodes.monitored,
TableShows.title,
@@ -1187,7 +1188,7 @@ def wanted_search_missing_subtitles_series():
providers = get_providers()
if providers:
- wanted_download_subtitles(episode['sonarrSeriesId'])
+ wanted_download_subtitles(episode['sonarrEpisodeId'])
else:
logging.info("BAZARR All providers are throttled")
return