Fixed episodes subtitles search when notified of import by Sonarr v3 SignalR feed. #1946

pull/1958/head v1.1.2-beta.10
morpheus65535 2 years ago
parent bc32ddbc57
commit c492de8b67

@ -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']

Loading…
Cancel
Save