From d6ddf76b68a7e645ec034c49d04a2aa8d41600c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Thu, 23 Jul 2020 21:20:14 -0400 Subject: [PATCH] Fix for #1031. Still better improvement ;-) --- bazarr/api.py | 4 ++-- bazarr/list_subtitles.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bazarr/api.py b/bazarr/api.py index 196d2946d..f127fe63b 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -405,7 +405,7 @@ class SeriesEditSave(Resource): pass else: for seriesId in seriesIdList: - list_missing_subtitles(no=seriesId, update_wanted=False) + list_missing_subtitles(no=seriesId, send_event=False) event_stream(type='series_editor', action='update') event_stream(type='badges') @@ -930,7 +930,7 @@ class MoviesEditSave(Resource): pass else: for radarrId in radarrIdList: - list_missing_subtitles_movies(no=radarrId, update_wanted=False) + list_missing_subtitles_movies(no=radarrId, send_event=False) event_stream(type='movies_editor', action='update') event_stream(type='badges') diff --git a/bazarr/list_subtitles.py b/bazarr/list_subtitles.py index a404d66e8..bc88cb303 100644 --- a/bazarr/list_subtitles.py +++ b/bazarr/list_subtitles.py @@ -169,7 +169,7 @@ def store_subtitles_movie(original_path, reversed_path): return actual_subtitles -def list_missing_subtitles(no=None, epno=None, update_wanted=True): +def list_missing_subtitles(no=None, epno=None, send_event=True): if no is not None: episodes_subtitles_clause = " WHERE table_episodes.sonarrSeriesId=" + str(no) elif epno is not None: @@ -231,13 +231,13 @@ def list_missing_subtitles(no=None, epno=None, update_wanted=True): database.execute("UPDATE table_episodes SET missing_subtitles=? WHERE sonarrEpisodeId=?", (missing_subtitles_item[0], missing_subtitles_item[1])) + if send_event: event_stream(type='episode', action='update', series=missing_subtitles_item[2], episode=missing_subtitles_item[1]) - if update_wanted: event_stream(type='badges') -def list_missing_subtitles_movies(no=None, update_wanted=True): +def list_missing_subtitles_movies(no=None, send_event=True): if no is not None: movies_subtitles_clause = " WHERE radarrId=" + str(no) else: @@ -293,8 +293,8 @@ def list_missing_subtitles_movies(no=None, update_wanted=True): database.execute("UPDATE table_movies SET missing_subtitles=? WHERE radarrId=?", (missing_subtitles_item[0], missing_subtitles_item[1])) + if send_event: event_stream(type='movie', action='update', movie=missing_subtitles_item[1]) - if update_wanted: event_stream(type='badges')