1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-23 08:13:14 +00:00

Fixed a search loop issue with missing subtitles for episodes. #1521

This commit is contained in:
morpheus65535 2021-08-29 20:27:15 -04:00
parent 84eecec98e
commit 3b4e81db5e

View file

@ -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