Fixed wanted subtitles tables not being refreshed on deleted or downloaded subtitles.

pull/1416/head
morpheus65535 4 years ago
parent 48ba08e068
commit 61b3b869d0

@ -300,11 +300,13 @@ def download_subtitle(path, language, audio_language, hi, forced, providers, pro
reversed_path = path_mappings.path_replace_reverse(path) reversed_path = path_mappings.path_replace_reverse(path)
reversed_subtitles_path = path_mappings.path_replace_reverse(downloaded_path) reversed_subtitles_path = path_mappings.path_replace_reverse(downloaded_path)
notify_sonarr(episode_metadata['sonarrSeriesId']) notify_sonarr(episode_metadata['sonarrSeriesId'])
event_stream(type='episode-wanted', action='delete', payload=episode_metadata['sonarrEpisodeId'])
else: else:
reversed_path = path_mappings.path_replace_reverse_movie(path) reversed_path = path_mappings.path_replace_reverse_movie(path)
reversed_subtitles_path = path_mappings.path_replace_reverse_movie(downloaded_path) reversed_subtitles_path = path_mappings.path_replace_reverse_movie(downloaded_path)
notify_radarr(movie_metadata['radarrId']) 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) track_event(category=downloaded_provider, action=action, label=downloaded_language)

@ -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)) subtitles_path=path_mappings.path_replace_reverse(subtitles_path))
store_subtitles(path_mappings.path_replace_reverse(media_path), media_path) store_subtitles(path_mappings.path_replace_reverse(media_path), media_path)
notify_sonarr(sonarr_series_id) notify_sonarr(sonarr_series_id)
event_stream(type='episode-wanted', action='update', payload=sonarr_episode_id)
return True
else: else:
try: try:
os.remove(path_mappings.path_replace_movie(subtitles_path)) 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)) subtitles_path=path_mappings.path_replace_reverse_movie(subtitles_path))
store_subtitles_movie(path_mappings.path_replace_reverse_movie(media_path), media_path) store_subtitles_movie(path_mappings.path_replace_reverse_movie(media_path), media_path)
notify_radarr(radarr_id) notify_radarr(radarr_id)
event_stream(type='movie-wanted', action='update', payload=radarr_id)
return True return True

Loading…
Cancel
Save