summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-09-25 08:38:27 -0400
committermorpheus65535 <[email protected]>2022-09-25 08:38:27 -0400
commitc492de8b670e11c7c5a33e57dd10dca04093c18e (patch)
treeb64037c0b69996b4a8bc3e7d5b2f4d53e8e655e8
parentbc32ddbc57589b5e0848aba1ab96efa1adfe28db (diff)
downloadbazarr-c492de8b670e11c7c5a33e57dd10dca04093c18e.tar.gz
bazarr-c492de8b670e11c7c5a33e57dd10dca04093c18e.zip
Fixed episodes subtitles search when notified of import by Sonarr v3 SignalR feed. #1946v1.1.2-beta.10
-rw-r--r--bazarr/app/signalr_client.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/bazarr/app/signalr_client.py b/bazarr/app/signalr_client.py
index 1f64ac479..0d3693841 100644
--- a/bazarr/app/signalr_client.py
+++ b/bazarr/app/signalr_client.py
@@ -18,6 +18,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
from .config import settings
from .scheduler import scheduler
@@ -236,8 +237,17 @@ def dispatcher(data):
series_title = data['body']['resource']['title']
series_year = data['body']['resource']['year']
elif topic == 'episode':
- series_title = data['body']['resource']['series']['title']
- series_year = data['body']['resource']['series']['year']
+ if 'series' in data['body']['resource']:
+ series_title = data['body']['resource']['series']['title']
+ series_year = data['body']['resource']['series']['year']
+ else:
+ series_metadata = TableShows.select(TableShows.title, TableShows.year)\
+ .where(TableShows.sonarrSeriesId == data['body']['resource']['seriesId'])\
+ .dicts()\
+ .get_or_none()
+ if series_metadata:
+ series_title = series_metadata['title']
+ series_year = series_metadata['year']
episode_title = data['body']['resource']['title']
season_number = data['body']['resource']['seasonNumber']
episode_number = data['body']['resource']['episodeNumber']