aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-08-07 08:45:39 -0400
committermorpheus65535 <[email protected]>2023-08-07 08:45:39 -0400
commit073f3a2cfabf7f3300f1b220033af0cc41baaf19 (patch)
tree3fb1b735d7a5f136d19cf92cb96172f8c127cc3d
parent487e3d55ed5c65e74ee7e5ebafab1a03c8962529 (diff)
downloadbazarr-073f3a2cfabf7f3300f1b220033af0cc41baaf19.tar.gz
bazarr-073f3a2cfabf7f3300f1b220033af0cc41baaf19.zip
Fixed Radarr SignalR deleted movie event being dropped for missing metadata in payload. #2219
-rw-r--r--bazarr/app/signalr_client.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/bazarr/app/signalr_client.py b/bazarr/app/signalr_client.py
index 047549174..8031305f4 100644
--- a/bazarr/app/signalr_client.py
+++ b/bazarr/app/signalr_client.py
@@ -19,7 +19,7 @@ from sonarr.sync.series import update_series, update_one_series
from radarr.sync.movies import update_movies, update_one_movie
from sonarr.info import get_sonarr_info, url_sonarr
from radarr.info import url_radarr
-from .database import TableShows, database, select
+from .database import TableShows, TableMovies, database, select
from .config import settings
from .scheduler import scheduler
@@ -275,8 +275,19 @@ def dispatcher(data):
season_number = data['body']['resource']['seasonNumber']
episode_number = data['body']['resource']['episodeNumber']
elif topic == 'movie':
- movie_title = data['body']['resource']['title']
- movie_year = data['body']['resource']['year']
+ if action == 'deleted':
+ existing_movie_details = database.execute(
+ select(TableMovies.title, TableMovies.year)
+ .where(TableMovies.radarrId == media_id)) \
+ .first()
+ if existing_movie_details:
+ movie_title = existing_movie_details.title
+ movie_year = existing_movie_details.year
+ else:
+ return
+ else:
+ movie_title = data['body']['resource']['title']
+ movie_year = data['body']['resource']['year']
except KeyError:
return