From 61b3b869d05ba1c219c1aa8efd19f20e843b5af1 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Tue, 25 May 2021 23:24:13 -0400 Subject: [PATCH] Fixed wanted subtitles tables not being refreshed on deleted or downloaded subtitles. --- bazarr/get_subtitle.py | 2 ++ bazarr/utils.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index eaa82e125..4aa16ab6b 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -300,11 +300,13 @@ def download_subtitle(path, language, audio_language, hi, forced, providers, pro reversed_path = path_mappings.path_replace_reverse(path) reversed_subtitles_path = path_mappings.path_replace_reverse(downloaded_path) notify_sonarr(episode_metadata['sonarrSeriesId']) + event_stream(type='episode-wanted', action='delete', payload=episode_metadata['sonarrEpisodeId']) else: reversed_path = path_mappings.path_replace_reverse_movie(path) reversed_subtitles_path = path_mappings.path_replace_reverse_movie(downloaded_path) notify_radarr(movie_metadata['radarrId']) + event_stream(type='movie-wanted', action='delete', payload=movie_metadata['radarrId']) track_event(category=downloaded_provider, action=action, label=downloaded_language) diff --git a/bazarr/utils.py b/bazarr/utils.py index 84ba58699..7c58de412 100644 --- a/bazarr/utils.py +++ b/bazarr/utils.py @@ -310,6 +310,8 @@ def delete_subtitles(media_type, language, forced, hi, media_path, subtitles_pat subtitles_path=path_mappings.path_replace_reverse(subtitles_path)) store_subtitles(path_mappings.path_replace_reverse(media_path), media_path) notify_sonarr(sonarr_series_id) + event_stream(type='episode-wanted', action='update', payload=sonarr_episode_id) + return True else: try: os.remove(path_mappings.path_replace_movie(subtitles_path)) @@ -323,6 +325,7 @@ def delete_subtitles(media_type, language, forced, hi, media_path, subtitles_pat subtitles_path=path_mappings.path_replace_reverse_movie(subtitles_path)) store_subtitles_movie(path_mappings.path_replace_reverse_movie(media_path), media_path) notify_radarr(radarr_id) + event_stream(type='movie-wanted', action='update', payload=radarr_id) return True